Allow Only Digits in Text Box | |||||||||||||||||||||||
|
|||||||||||||||||||||||
Public Function OnlyDigitsOnKeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Try If System.Char.IsDigit(e.KeyChar) = False And e.KeyChar <> Microsoft.VisualBasic.Chr(8) And e.KeyChar <> Microsoft.VisualBasic.Chr(46) Or (InStr(sender.text, ".") > 0 And e.KeyChar = Microsoft.VisualBasic.Chr(46)) Then e.Handled = True End If Catch ex As Exception Common.ErrorHandler(ex) End Try End Function |
|||||||||||||||||||||||
|
|||||||||||||||||||||||
| Leave a Comment | |||||||||||||||||||||||
|
|||||||||||||||||||||||