Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...