So I'm having a bit of a problem handling a situation. I have an application, which is an MDI application, which opens custom documents. My MDI parent has a ToolStrip, with a few controls, a text box and a button. The text box holds a qty value for an item, then there is a button to add the item to the document. the model for fastest operation is, starting with the qty text box, enter the qty, tab to the part number text box and enter the part #, then tab to the add button and hit either enter key or space key. This is way faster than using the mouse to click the button, or click to enter the text box. So I want my app to auto focus the qty text box once the button is fired.
I've handled the ToolStripMenuItem.Click event, which adds the item, and then refocuses the qty box, and it works perfectly when the mouse is used to click the button. But for some reason I've yet to discover, this does NOT work for when the keyboard triggers the button. I know the click event is being triggered, because the item gets added properly, but the focus is not handled correctly. In fact, in this case, it seems the focus is just lost completely, tab ceases to function, focus can't be regained except with the mouse. I've tried the following:
Call Form.Activate() i the parent form, and handle the Activated event to focus the text box.
Call Focus() on the parent form, and handle the GotFocus event to focus the text box.
It's as if the underlying framework fails to properly handle key events, and there are no Key events exposed for the ToolStripMenuItemButton control. I'm sort of at a loss. The app is functional, as the mouse works, and the app can actually be used, but for best functionality I need to get this working so that fast data entry can be done without the use of the mouse.