'只能输入数字不就行了? Private Sub Text1_KeyPress(KeyAscii As Integer) KeyAscii = IIf(InStr("0123456789" & Chr(8), Chr(KeyAscii)) = 0, 0, KeyAscii) End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then '//判断输入的是否为数字或小数点 else KeyAscii = 0 End If End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = IIf(InStr("0123456789" & Chr(8), Chr(KeyAscii)) = 0, 0, KeyAscii)
End Sub
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then '//判断输入的是否为数字或小数点
else
KeyAscii = 0
End If
End Sub