How can I disable the F4 key from showing the items in a ComboBox

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-05-05T16:12:57Z Indexed on 2010/05/05 16:18 UTC
Read the original article Hit count: 172

You might not know this, but pressing the F4 key on a ComboBox makes it's drop-down item list appear. I believe this is the default behavior on Windows.

Does anyone know how to override this behavior in WPF (C#)?

I know that overriding default behavior is generally seen as bad practice, however in this case I have a rugged-device that runs XP Embedded. It has a handful of prominent Function keys (F1-F6) that need to trigger different events. This works fine, however when focused over a ComboBox the events aren't triggered as the ComboBox drops down.

I have tried catching the KeyDown event both on the form and on the ComboBox and listening for the F4 key, however it doesn't get this far as the key press must be handled at a lower level.

Any ideas? Thanks.

© Stack Overflow or respective owner

Related posts about combobox

Related posts about key