spooke Posted September 30, 2003 Posted September 30, 2003 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 Quote
Administrators PlausiblyDamp Posted September 30, 2003 Administrators Posted September 30, 2003 If you don't want the ComboBox to process the key then in the KeyPress event set e.Handled = true Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
spooke Posted September 30, 2003 Author Posted September 30, 2003 that does'nt work tried don't work Quote
Administrators PlausiblyDamp Posted September 30, 2003 Administrators Posted September 30, 2003 What style is the combobox set to? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Experts* mutant Posted September 30, 2003 *Experts* Posted September 30, 2003 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: If e.KeyChar = Convert.ToChar(97) Then e.Handled = True End If Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.