ascii in combo

spooke

Newcomer
Joined
Jun 9, 2003
Messages
4
Location
england _south west
I am having problems blocking keycodes on a combobox say for instance if keycode<>0 then i want the keycode as 0

in vb 6 you would use the ascii method with keypress that does no longer work have tried key up and keydown nothing seems to work.

Also when attempting to lock a combobox using the lock property does not work. the user is still able to enter text.

Thanx in advance

Spooke
 
Lock is designer only property.
Are you trying to block the user from entering some particular character or any? If any then setting the DropDownStyle to DropDownList would do it. What PlausiblyDump showed you works. Look at this example:
Visual Basic:
If e.KeyChar = Convert.ToChar(97) Then
  e.Handled = True
End If
 
Back
Top