Windows Develop Bookmark and Share   
 index > Windows Forms General > MDI Keystrokes
 

MDI Keystrokes

So I have a MDI application, all MDI child windows extend a MDI base form class so they all have common code.

What I want to do is capture keystrokes and look for a special key event from a barcode scanner, when this keystroke is intercepted, I want to cancel the event and focus on a text control in my parent window (always docked on the left side) that understands barcodes.

My problem is, I can't seem to intercept the keystrokes.
MigrationUser 1  Tuesday, March 01, 2005 12:14 PM
Set the KeyPreview property of the parent form to True.

All key strokes will now cause the parent's key events to fire before the actual control that has focus.  You then set the Handled property of e in the parent's key events to True if you don't want to pass that key to the control with focus, or False if you do.
MigrationUser 1  Tuesday, March 15, 2005 4:46 PM
That did the trick!
MigrationUser 1  Wednesday, March 16, 2005 2:58 PM

You can use google to search for other answers

Custom Search

More Threads

• Need windows explorer search string that creates a file search list then excludes certain files from the list.
• Using PrintDocument to print Alpha-Blended GDI+ vector graphics (Alpha Blending Transparency Printing .Net)
• working with a scanner moving from text box to text box
• Enabling a button after text input
• How can I stop it from going to SelectedIndexChanged????!
• Refresh time in datetimepicker control
• How to add controls dynamically depending of the type of an enum? Which Design Pattern...?
• A few questions about ExpandableObjectConverter and PropertyGrid
• How to block events in a form
• Help fixing my insert inmage control!