Accept Only One Decimal(.) Point in TextBox in Vb.net

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim dot As Integer
If Not e.KeyChar = “.” And Not Char.IsNumber(e.KeyChar) Then
e.Handled = True
End If
If e.KeyChar = Chr(&H8) Then
e.Handled = False
End If
If e.KeyChar = “.” And Not TextBox1.Text.IndexOf(“.”) = -1 Then
e.Handled = False
dot = TextBox1.Text.IndexOf(“.”)
If dot > -1 Then
e.Handled = True
End If
End If
End Sub

Advertisements

:Catch Me

Ganesh Kadam

Create Your Badge

Using grid as a TreeView in vb.net

Using grid as a tree View:
To show datagrid as a tree in vb.net as shown in figure below:
Click link to get Full Article with code in Vb.net :Using grid as a tree