Click here to Skip to main content
16,020,261 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Is there a way to create a context menu with vertical scroll bar using c# WinForm.
I want to add menu items dynamically.
Posted
Updated 2-Jun-14 3:31am
v2
Comments
Pikoh 2-Jun-14 9:45am    
I really can't think a situation where a context menu with so many options that needs a scroll bar is useful. Why don't you organize that context menu in submenus avoiding tha scroll bar?

BTW, here you have a great context menu http://www.codeproject.com/Articles/677074/Enhanced-ContextMenuStrip
Sergey Alexandrovich Kryukov 2-Jun-14 9:58am    
Agree. I can imagine the frustration of a user trying to locate an item and eventually loosing it...
—SA

1 solution

No. A standard context menu can't have a scroll bar, and frankly I agree with the comments: this is a good thing, a menu with that many items is not likely to be useful.

If you want to create a UI like that you'll have to handle the right click yourself and pop up another window which has context menu like behaviour (capture the mouse, close the window if you click off it, press Esc or switch focus away from the application).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900