I have a MenuStrip in one of my forms so that the user has a menu bar they can choose various things from. For convenience, some also have key shortcuts mapped to them. I've also achieved a custom look for all the items and their submenus by overriding the MenuStrip's renderer.
The problem occurs when I use a key shortcut for an item with a dropdown list attached to it. When the list is down, if I hit the escape key, the list will close as expected, but the parent item is still selected. It's still highlighted, and it still has focus. Pressing the escape key again doesn't do anything. I take it that I'm suppose to implement this behavior myself? If so, how? ToolStripMenuItems don't seem to have any function calls that will tell it to unselect.
Edit: In case anyone is curious, I am looking capturing the escape key in the form's KeyDown event. I use it to quit the form. Here's the code:
Private Sub myForm_KeyDown(sender as Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.Escape Then
Me.Close()
e.Handled = True
End If
End Sub
But even when I comment this out, I'm still getting the above behavior.