Version

Show the MiniToolbar with a Context Menu

{Warning}

You can show the MiniToolbar automatically whenever the WinToolbarsManager context menu is shown. To do this, you need to set the MiniToolbar’s AutoShow property to OnContextMenuClick (which is the default setting). You need to set the Context Menu by using WinToolbarsManager’s™ SetContextMenuUltra method. This method has two parameters, the control you’d like to set the context menu on, and the context menu WinToolbarsManager will use on that control. For more information on setting up the Context Menu, see Replace a Control’s Context Menu with a PopupMenu Tool. Once the context menu is set, the MiniToolbar will automatically display above the context menu.

The following code, placed in the form’s Load event, will set a context menu for a WinButton control and automatically display the MiniToolbar above it.

In Visual Basic:

Imports Infragistics.Win.UltraWinToolbars
...
Me.UltraToolbarsManager1.SetContextMenuUltra(Me.UltraButton1, "FontWeight")
Me.UltraToolbarsManager1.MiniToolbar.AutoShow = _
  MiniToolbarAutoShow.OnContextMenuClick

In C#:

using Infragistics.Win.UltraWinToolbars;
...
this.ultraToolbarsManager1.SetContextMenuUltra(this.ultraButton1, "FontWeight");
this.ultraToolbarsManager1.MiniToolbar.AutoShow =
  MiniToolbarAutoShow.OnContextMenuClick;