How to fix weird scrolling/alignment behavior when using keyboard in MenuStrip?
- by bentsai
I started noticing strange behavior when navigating the main toolbar of my Winforms application, and I don't know how to fix it. When I initially open the dropdown of the File menu, it looks like this:
I begin to scroll down each item with the arrow keys, and everything is fine until I reach "Exit". As soon as I hit the down arrow key from "Log Off", or if I hit the up arrow key from "Open", the menu rearranges itself to look like this:
I'm puzzled by this behavior. The menu still works, and from this point, if I start scrolling up, I can get the arrangement back to normal:
A few observations:
The menu still works.
This doesn't happen when using the mouse.
I have some code that toggles the Visible property of some of the menu items. I was able to modify what the arrangement was by playing around with this, but it was still messed up.
Can anyone help me understand what is going on, and how to fix it?