source code textbox limit character
TRANSCRIPT
-
7/21/2019 Source Code Textbox Limit Character
1/1
Berikut code program yang hanya data numeric/ number yang boleh di masukan dalamtextbox :
Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii 57 Then KeyAscii = 0End Sub
Cara tersebut hanya menerima karakter 0 sampai dengan 9 saja, supaya tombol lainnya seperti Delete BackSpace, dan SpaceBar juga bisa diterima Berikut codenya :
Private Sub Text2_KeyPress(KeyAscii As Integer)If Not (KeyAscii >= Asc("0") & Chr(13) _And KeyAscii