讓TextBox只能輸入數字可以在TextBox的KeyPress事件中輸入:
If KeyAscii <> 8 And KeyAscii < 48 Or KeyAscii > 57 Then
Beep '振鈴
KeyAscii = 0 '取消鍵入
End If
讓TextBox只能輸入數字可以在TextBox的KeyPress事件中輸入:
If KeyAscii <> 8 And KeyAscii < 48 Or KeyAscii > 57 Then
Beep '振鈴
KeyAscii = 0 '取消鍵入
End If