Source code berikut untuk memfungsikan  textbox hanya bisa menerima input huruf. Bisa digunakan untuk input  nama atau yang lainnya yang tidak menggunakan angka.
 Yang diperlukan :
1 Form
1 TextBox
 Source code pada Form : 
 1 | Public Sub HanyaHuruf(ByRef  KeyAscii As  Integer) | 
2 |     If Not (KeyAscii >= Asc("a") & Chr(13) And  KeyAscii <= Asc("z") & Chr(13) Or (KeyAscii >= Asc("A") & Chr(13) And KeyAscii <=  Asc("Z")  & Chr(13) Or KeyAscii = vbKeyBack Or KeyAscii = vbKeyDelete Or  KeyAscii = vbKeySpace)) Then | 
7 | Private Sub Text1_KeyPress(KeyAscii As  Integer) | 
  Download Source Code
                 
0 komentar:
Posting Komentar