Private Sub AllowOnlyNumber(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If (Microsoft.VisualBasic.Asc(e.KeyChar) < 48) _ Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 57) Then e.Handled = True End If If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) Then e.Handled = False End If If (e.KeyChar = ".") Then e.Handled = False End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)