tags:

views:

53

answers:

3

I have a Form with several special controls on it that is the main window of my application. I would like to capture all key presses while my application is running, at the form level, rather than on the focused control or anything like that. What is the standard way to do this in WinForms?

+2  A: 

set Form.PreviewKeys = true, then you get all keyboard event.

Benny
This works fine. I just overrode the ProcessCmdKey event and it seems to work.
CaptnCraig
A: 

Set the Form's KeyPreview property to true and then handle one of the keypress events.

Michael Todd