You could just add code to the _KeyPress event and trap for undesireable
characters before they get in.
VB Code:
Private Sub txtIPAddress_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 46, 48 To 57, 8 'Numbers, decimal, and backspace only Case Else Beep KeyAscii = 0 'Cancels the keypressed character End Select End Sub





Reply With Quote