Private Sub Text1_Change(Index As Integer)
Private Sub Text1(1)_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 8
Case 46
If InStr(Text1, ".") <> 0 Then KeyAscii = 0
Case 47 To 57
Case Else
KeyAscii = 0
End Select
End Sub
End Sub
第1个回答 2010-10-06
sub是不能嵌套的。
你的两个方法嵌套到一起了。
去掉:Private Sub Text1_Change(Index As Integer)
和一个End Sub
如下:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 8
Case 46
If InStr(Text1, ".") <> 0 Then KeyAscii = 0
Case 47 To 57
Case Else
KeyAscii = 0
End Select
End Sub本回答被提问者采纳
你的两个方法嵌套到一起了。
去掉:Private Sub Text1_Change(Index As Integer)
和一个End Sub
如下:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 8
Case 46
If InStr(Text1, ".") <> 0 Then KeyAscii = 0
Case 47 To 57
Case Else
KeyAscii = 0
End Select
End Sub本回答被提问者采纳