可以定义一个键盘事件Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii < Asc("0") Or KeyAscii > Asc("9") ThenMsgBox "Enter a number"KeyAscii = 0End IfEnd Sub
设置文本框的数字属性啊