Prevent key-event in combobox when using control and KeyPreview

  • Thread starter Thread starter Peter Hartlén
  • Start date Start date
P

Peter Hartlén

Hi!

I want to use Ctrl + "Key" in a _combobox_, using Form KeyPreview. How do I
prevent the "Key" being passed on the to the controls base key-eventhandler?

The problem is that if I use Ctrl+B and there is an entry in the combobox
which starts with B, it will be selected.

Regards,

Peter
 
Doesn't work when using Form KeyPreview.

Atleast not in a KeyDown eventhandler. It seems like the KeyPress
eventhandler works for this, but then I have trouble knowing if the user has
pressed Ctrl+"Key".

There is some simple testcode in the thread "Ctrl+Enter on ComboBox and the
Letter J" posted on 2008-04-04.

Regards,

Peter


"Arun" <[email protected]> skrev i meddelandet
Set the Handled property to true.
e.Handled = true;
 
Back
Top