Input Textbox only Number and Decimal Point using VB6

Here script how to implement with textbox which you can only input numeric type and decimal point.


only numeric
Only Numeric


Private Sub TxtTotalHour_KeyPress(KeyAscii As Integer)

    If KeyAscii = 46 And InStr(TxtTotalHour.Text, ".") > 0 Then
        KeyAscii = 0
    End If
   
    If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9")) And KeyAscii <> vbKeyDelete And KeyAscii <> vbKeyBack And KeyAscii <> vbKeyReturn Then
        KeyAscii = 0
    End If

End Sub

Input Textbox only Number and Decimal Point using VB6
Item Reviewed: Input Textbox only Number and Decimal Point using VB6 9 out of 10 based on 10 ratings. 9 user reviews.
Emoticon? nyengir

Berkomentarlah dengan Bahasa yang Relevan dan Sopan.. #okemasbro! ^_^

Komentar Terbaru

Just load it!