PDA

Click to See Complete Forum and Search --> : disable some characters


bubani
Nov 8th, 2004, 07:57 AM
hey there,

i want to know how i can manipulate a textarea so the user can only fill in the numbers 0123456789 and abcdef, so there will be only the possibility to fill in a MAC-adress. Can somebody help me?


thanx

RobDog888
Nov 8th, 2004, 01:28 PM
Use the keypress event to filter out characters you dont want
entered into your control.
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)

Select Case KeyAscii
Case 48 To 57, 8 'NUMBERS ONLY & BS
'OK
Case Else
Beep
KeyAscii = 0
End Select

End Sub