TextBox Hanya Menerima Input Huruf
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 :
Public Sub HanyaHuruf(ByRef KeyAscii As Integer)
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
KeyAscii = 0
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
HanyaHuruf KeyAscii
End Sub
Categories: Visual Basic 6
hanya huruf, source code, textbox, vb 6, Visual Basic 6
Komentar Terakhir