dim strNumber as string
strNumber = txtNumber.text txtNumber 为一TextBox
if strNumber<>"" then
for i= 1 to Len(strNumber)
strchar = Mid(strNumber,i,1)
...........?
...全文
8612打赏收藏
请问如何判断textbox中输入的字符串全部由数字组成?
请问如何判断textbox中输入的字符串全部由数字组成? dim strNumber as string strNumber = txtNumber.text txtNumber 为一TextBox if strNumber"" then for i= 1 to Len(strNumber) strchar = Mid(strNumber,i,1) ...........?
Private Sub Text1_KeyPress(KeyAscii As Integer)
Key = Chr(KeyAscii)
Select Case KeyAscii
Case 48 To 57
n = Val(Left(Text1.Text, Text1.SelStart) + Key + Mid(Text1.Text, Text1.SelStart + Text1.SelLength + 1))
If n > MaxSenvalue Or n < MaxSenvalue Then
KeyAscii = 0
End If
Case 8