泊是不是多音字:VB怎样限定输入的文本只能是正数啊?
来源:百度文库 编辑:中科新闻网 时间:2024/05/17 06:42:34
Private Sub Text1_Change()
If Text1.Text <> "" Then
tp = Asc(Right(Text1.Text, 1))
If tp < Asc("0") Or tp > Asc("9") Then
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
Text1.SelStart = Len(Text1.Text)
End If
End If
End Sub