PC Review


Reply
Thread Tools Rate Thread

Catch Key Down Event anywhere on Windows Form

 
 
Ben
Guest
Posts: n/a
 
      18th Nov 2006
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2VuIFR1Y2tlciBbTVZQXQ==?=
Guest
Posts: n/a
 
      18th Nov 2006
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
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Catch the closing event of a form when clicked on X Michael Maier Microsoft Dot NET Compact Framework 2 27th Sep 2007 10:54 AM
How to catch a form minimize event? Terry Olsen Microsoft VB .NET 8 15th Nov 2005 05:12 PM
Re: Catch a form minimize event Sergey Bogdanov Microsoft Dot NET Compact Framework 0 5th Sep 2005 09:33 AM
Catch sort event from form Sascha Hennig Microsoft Access 7 17th Jul 2005 10:35 PM
catch ActiveX event in outlook form =?Utf-8?B?Y2FzdGxlODAwMA==?= Microsoft Outlook Form Programming 1 7th Jun 2005 12:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:01 PM.