How to break a context menu into more than one column in Winforms?

I have a ContextMenuStip that contains a dynamically generated list of ToolStripMenuItem objects. The problem is that when there are too many of them to fit onto the screen, tiny scroll buttons appear at the top and at the bottom of the list, and scrolling through the list is a bit tedious.

How can I make the menu to automatically break into 2 or more columns so the user does not have to scroll?


This behaviour was dropped from Windows some while ago -note that Windows Vista/7 use a tree to show programs in the start menu. I suspect that this was because it presents too much data and decision making for the user.

Are you sure that this is the best way to present the choices to the user?

If so, then you will probably need a custom menu control which will be quite a lot of work.

  • If not, then you should consider how you can achieve the same choices with other controls. How about a list with a filter?
  • Is there some natural grouping to the items? If so you could split into listboxes, comboboxes or trees.
  • Does the application need splitting into different modes?
  • Are the items numbers? - if so a numeric up/down control might work
  • The general approach is to simplify the amount of decision making that the user has to make at any moment.

    Spend some time playing with all the controls in the WinForms toolbox to see what works well.

    链接地址: http://www.djcxy.com/p/27820.html

    上一篇: 使第一列始终可见?

    下一篇: 如何在WinForms中将上下文菜单分成多个列?