PlanetBlog - Komunitas Blog Indonesia

Senin, 05 Desember 2011

Agar dalam Textbox hanya dapat Ditulis Angka

Saya punuya codingnya agar textbox hanya dapat diisi angka .

Private Sub tharga_KeyPress(KeyAscii As Integer)
If InStr("1234567890.", Chr(KeyAscii)) = 0 And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyReturn And KeyAscii <> vbKeyTab Then KeyAscii = 0

If KeyAscii = vbKeyReturn Then tqty.SetFocus
If KeyAscii = vbKeyTab Then tqty.SetFocus
End Sub

Selamat mencoba :)

0 comments:

Template by:

Free Blog Templates