SubMenu
Finally I have the ability to actually show a sub menu when the mouse hovers or presses an item that has a child collection of items. Here you can see a simple example…

SplitMenu
A nice feature in Office 2007 is the ability to split a menu item that has a collection. So if you press to the left of the item splitter it acts like a regular menu item, generating a click event and closing the menu. If you press to the right of the splitter or just hover over the item then it shows the sub menu. You can see the splitter here…

This is useful in the example shown. Here if you pressed the Open item to the left of the splitter you could open up a regular windows open dialog for selecting a file to open. But the sub menu still allows you to select recently opened documents such as OldFile.txt.

So you get the best of both worlds with a simple and obvious interface. Here you can see how it looks with the system palette…

 

Bounce
When you open up a sub menu it needs to check to ensure it does not display partially off the screen. If you play with a regular menu you will notice that it bounces around the screen. Now the KryptonContextMenu does the same thing. Here I have a three level menu structure…

When the first sub menu opens it defaults to being on the right hand side and below the selected item. But opening the next level of sub menu would have caused it to show off the monitor. So instead it bounces and now opens on the left side of the parent selection. This works against any of the monitor edges. When it bounces it keeps going in that direction, so if I had opened up even more levels it would keep opening to the left side until it then reaches the left monitor edge.

 It can be quite funny creating a menu with 50 sub menu levels and constantly opening them to see the menus bouncing around the screen.

8 Responses to “SubMenu, SplitMenu + Bounce”

  1. Ian Sinke Says:

    In Office 2003, when you’re selecting toolbar items from the drop-down menu at the end of the toolbar, the list of items doesn’t disappear after you click one item. This makes it a lot quicker to add or remove a bunch of items. Will Krypton Context Menu provide this functionality?

  2. Phil Wright Says:

    Yes, you can specify a property on the menu item and it will stop the menu from being dismissed when it is clicked. You can use this to toggle the checked state without causing it to be removed.

  3. Sebastian Pauls Says:

    Will it be possible to merge two or more menus together in the final version? Would be a great feature because the Menustrip control is only ale to merge two menus but not more.

  4. Phil Wright Says:

    No, you cannot merge more than one context menu together. Not sure this is really needed for context menus.

  5. Sebastian Pauls Says:

    I just thought about a replacement of the menustrip in Visual Studio.

  6. Phil Wright Says:

    The KryptonContextMenu is a replacement for a popup menu but does not replace the MenuStrip that comes with .NET 2.0. It is intended for use with controls like the Ribbon or Navigator. Although I will also be adding it to the Toolkit controls as well.

  7. jkr Says:

    Does this mean we’ll have a SplitButton ?

  8. Phil Wright Says:

    No, it means right clicking the control can show a krypton context menu.

Leave a Reply