By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

Catch Key Down Event anywhere on Windows Form

P: n/a
Ben
Hi

I would like to complete a task whenever F4 is pressed by the user anywhere
on a form.

The problem is the Key Down event does not fire for the form if the user is,
for example within a text box. Is there any method of doing this other than
adding the code to the key down event for all controls?

Thanks
B
Nov 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

If you set the forms keypreview property to true the form will get
the keydown before the textbox.

http://msdn2.microsoft.com/en-us/lib...eypreview.aspx

Ken
--------------------------

"Ben" wrote:
Hi

I would like to complete a task whenever F4 is pressed by the user anywhere
on a form.

The problem is the Key Down event does not fire for the form if the user is,
for example within a text box. Is there any method of doing this other than
adding the code to the key down event for all controls?

Thanks
B
Nov 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.