Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / April 2008

Tip: Looking for answers? Try searching our database.

Globally capturing keyboard events for a WinForm application?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Fuller - 09 Apr 2008 22:47 GMT
I've done this before, but no longer have the code and can't remember how.
Does anyone have an example on how to globally monitor keyboard events for
an application and modify them to treat, for example, an "ENTER" event as a
"Tab" event... or something similar.
Gilles Kohl [MVP] - 09 Apr 2008 23:00 GMT
Bill,

>I've done this before, but no longer have the code and can't remember how.
>Does anyone have an example on how to globally monitor keyboard events for
>an application and modify them to treat, for example, an "ENTER" event as a
>"Tab" event... or something similar.

Hmm, are you referring to the "KeyPreview" property of the form,

http://msdn2.microsoft.com/en-us/library/system.windows.forms.form.keypreview.aspx

or something more drastic?

  Regards,
  Gilles.
Bill Fuller - 09 Apr 2008 23:40 GMT
> Bill,
>
[quoted text clipped - 12 lines]
>   Regards,
>   Gilles.

That looks familier, but I need to set this at application logon to apply to
the main from and all child forms and believe I had to do something in
particular to do this. Also, I need to be able to recognize an Enter key and
treat it as a tab key... same with the down arrow.

Kludgy, I know... but the client is insisting on this behavior.
Gilles Kohl [MVP] - 09 Apr 2008 23:51 GMT
>> Bill,
>>
[quoted text clipped - 19 lines]
>
>Kludgy, I know... but the client is insisting on this behavior.

Hmm, a quick search found this:

http://www.syncfusion.com/FAQ/winforms/FAQ_c46c.aspx#q905q

Maybe that's what you used?

  Regards,
  Gilles.
Bill Fuller - 10 Apr 2008 00:01 GMT
>>> Bill,
>>>
[quoted text clipped - 33 lines]
>   Regards,
>   Gilles.

Ahhh...IMessageFilter... that was it. Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.