Using C# with .Net 2.0 (though the problem occurs in 4.0)
There appears to be a bug involving the focus of the ToolStrip control and ToolStripControlHosts in Windows Forms.
Consider this example: The user clicks on ToolStripMenuItem "Test A", then diagonally moves the mouse onto the drop down ToolStripMenuItem "5". When dragging diagonally the mouse passes over "Test B", but when the mouse enters the drop down list, the focus is moved back from "Test B" to "Test A" automatically. This works correctly.
Example 1 : https://i.stack.imgur.com/0X9mZ.png
Now consider a similar example but with a ToolStripControlHost in the drop down list. The mouse moves diagonally, passing over "Test B" which receives focus. When the mouse enters the ToolStripControlHost, the focus is NOT returned to the parent "Test A", and therefore the drop down list closes and the ToolStripControlHost is hidden.
Example 2 : https://i.stack.imgur.com/XJ75K.png
My question is, how can I handle this situation? Is there a way to force the focus onto the ToolStripMenuItem "Test A"?
I have tried setting the autoclose property of "Test A"'s DropDown to false, and then manually handling the close event, but this causes several issues. When the ToolStripControlHost is clicked, the ToolStrip receives an OnClose event with the ToolStripDropDownCloseReason being AppClicked. Additionally any textboxes within the ToolStripControlHost do not receive text events because the ToolStrip appears to be consuming them (backspace moves the focus up in the drop down list, rather than deleting text etc.).
Thanks for your help
Simon