,你试一下下面的!
Private Sub Text1_Change()
If Not IsNumeric(Text1.Text) And Len(Text1.Text) <> 0 Then
Text1.Text = Mid(Text1.Text, 1, Len(Text1.Text) - 1)
MsgBox "必须输入数字!", vbOKOnly, "输入数据类型错误"
Text1.SelStart = Len(Text1.Text)
ElseIf Len(Text1.Text) = 0 Then
Text1.Text = ""
Text1.SelStart = Len(Text1.Text)
End If
End Sub
04-09-27 09:55