how to: application wide keyboard hook

  • Thread starter Thread starter ~dr-sci-fi
  • Start date Start date
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
 
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
 
Back
Top