how to: application wide keyboard hook

D

~dr-sci-fi

hi all,

problem: i have several controls on my form which can get focus, like
buttons/combos. i have to catch keyboard events for special keys like Alt-F1
on my form, for that, i simply implemented keydown event handler on my form
control, but when some other control has focus, all keypress events are
generated on that control.

Q: how can i implement an application wide keypress event handler, so that
if Alt-F1 is press on any control (or on any dialogue of the app), my single
event handler can grab it?

TIA

- sci
 
C

ClayB [Syncfusion]

Try setting Keypreview = true for your form. This should allow its key event
handlers to catch most keys...

===================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top