I have a combo box I want to limit user input
I have the following code on 'keypress' event
dim keyascii as short = asc(e.keychar)
dim s as string
if keyascii = 45 then
exit sub
end if
' allow '-' key
s=checkalphanumeric(s,"AN")
' My function to check keyascii
's returns 0-9, a-z, A-Z if true
if s="" then
exit sub
end if
e.handled=true
end sub
I have same code used for text boxes except 'e' is 'eventargs' & it works
I can still type anything in my combo box, am I missing something?
any help much appreciated