Hello,
I'm trying to allow digits, function keys and chr(46) ie '.' to be typed in a text box. However I cannot seem to get the chr(46) inclusion to work. The following works
Private Sub txtStrike_KeyPress(ByVal sender As System.Object, ByVal e As KeyPressEventArgs) Handles txtStrike.KeyPress
If Not (Char.IsDigit(e.KeyChar) Or Char.IsControl(e.KeyChar)) Then e.Handled = True
End Sub
...but if i add <<Or CharIsPunctuation(chr(46))>> then the text box doesn't allow any typing whatsoever.
Thanks......
I'm trying to allow digits, function keys and chr(46) ie '.' to be typed in a text box. However I cannot seem to get the chr(46) inclusion to work. The following works
Private Sub txtStrike_KeyPress(ByVal sender As System.Object, ByVal e As KeyPressEventArgs) Handles txtStrike.KeyPress
If Not (Char.IsDigit(e.KeyChar) Or Char.IsControl(e.KeyChar)) Then e.Handled = True
End Sub
...but if i add <<Or CharIsPunctuation(chr(46))>> then the text box doesn't allow any typing whatsoever.
Thanks......