Hi, i have a problem with the KeyPress event, it just doesn't seem to work, i debuged the event and when it exits the sub with e.Handled = False it still let the chars in the textbox. I've tried to set KeyPreview property of the Form to True, but it still doesn't work. Thanks!
Private Sub txtIP_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtIP.KeyPress
If (Microsoft.VisualBasic.Asc(e.KeyChar) < 58 _
And Microsoft.VisualBasic.Asc(e.KeyChar) > 47) Or _
(Microsoft.VisualBasic.Asc(e.KeyChar) = 46) Then
e.Handled = True
Else
e.Handled = False
End If
End Sub