views:

1198

answers:

2

I have a context menu strip with 8 items and two separators. When the user brings up the context menu strip, then hits the arrow key to scroll through the items, hitting the eighth item causes the menu to 'scroll' up, leaving blank space at the bottom. Is there any way to prevent that behaviour?

A: 
Jon
What OS ver. do you use?I just tried your issue on vista and it doesn't occur.If you use vista, please post the code and will test it, maybe I can help.
Shimmy
Yes, that's exactly what I'm seeing with my right-click context menus. It really does seem like a flaw in the menu itself, I couldn't find anything that would allow me to change that functionality in the documentation. Perhaps if I had time, I could dig in with a reflector and figure out how to override that behaviour...
genki
Well this is the strange thing. This behavior only happens on that Reports drop-down in my app.. All the other dropdowns are fine.
Jon
I think it might have a minimum number of items requirement. I'll check to see if any other of my menus have this behaviour.
genki
+3  A: 

I found it. It turns out that if you have items in the menu that are not visible, it screws with the spacing. The fix was to change the logic to actually remove/add items or rebuild the menu rather than toggling menu item visibility. This is one case where toggling .Visible had some odd behaviour.

genki