Hi.. I'm doing a project on Vb.net 2008.. There's a textbox called "Price" which requires validation.. The validation is that the textbox should not enter dot, special characters or alphabets as the first character.. The Dot should only be active after the number which is entered on the textbox.. for now i'm using this code.. Thanks in advance
Private Sub txt7_pprice_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txt7_pprice.KeyPress
If Char.IsDigit(e.KeyChar) Or (Asc(e.KeyChar) = Asc(".")) And Me.txt7_pprice.Text.Count(Function(c As Char) c = ".") = 0 Then
e.Handled = False
ElseIf Asc(e.KeyChar) = 8 Then
e.Handled = False
Else
e.Handled = True
End If
End Sub