Decimal Point

You can do the following:

Code:
 Private Sub text1_keypress(ByVal sender As System.Object, ByVal e As KeyPressEventArgs) Handles TextBox1.KeyPress
       Dim intDeccheck As String
        intDeccheck = Microsoft.VisualBasic.InStr(Me.TextBox1.Text, ".", CompareMethod.Text)

        If (Asc(e.KeyChar) = 46) Then
            If intDeccheck > 0 Then
                e.Handled = True
            End If
        End If
    End Sub
 
Back
Top