Private Sub Text2_KeyPress(KeyAscii As Integer)
Text1_KeyPress(KeyAscii)
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
Text1_KeyPress(KeyAscii)
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
Text1_KeyPress(KeyAscii)
End Sub
....
[Quote=引用 4 楼 juanzi_86 的回复:]
还有要求能输入空格 忘啦
[/Quote]
Private Sub Text1_KeyPress(KeyAscii As Integer)
If keyascii <> asc(" ") and keyascii <> 8 and KeyAscii <> Asc(".") And (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) Then
KeyAscii = 0
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> Asc(".") And (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) Then
KeyAscii = 0
End If
End Sub