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 / Windows Forms / WinForm General / March 2006

Tip: Looking for answers? Try searching our database.

Trapping Key Presses.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 14 Mar 2006 15:22 GMT
I want to trap a key press for my application but the application does not
seem to trigger the KeyPress,KeyDown or KeyUp events. I have a menu and a
picture on the main dialog. Is this a focus issue? or do I need to add
further event handling?
Signature

Steve H.

Mehdi - 14 Mar 2006 15:51 GMT
> I want to trap a key press for my application but the application does not
> seem to trigger the KeyPress,KeyDown or KeyUp events. I have a menu and a
> picture on the main dialog. Is this a focus issue? or do I need to add
> further event handling?

A form's KeyPress, KeyDown and KeyUp events are fired only if the form
itself has the focus. If a child control within the form has the focus,
then this is this control's KeyPress, KeyDown and KeyUp events that are
going to be fired. You can force your form's events to be fired first even
if the focus is on one of its child control by setting its KeyPreview
property to true.

Rate this thread:







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.