Description
Adds a menu separator to the master menu of the application menu.
Applies to
Syntax
controlname.AddMasterSeparatorItem ( { Long ParentIndex } )
Argument |
Description |
---|---|
controlname |
The name of the RibbonApplicationMenu control into which you want to insert a menu separator. |
ParentIndex |
The index of the menu item (RibbonMenuItem) into which you want to insert a submenu separator. It cannot be an index of a separator. If not specified, a separator will be added at the end of the menu; if specified to a valid value, a separator will be added at the end of the submenu under the menu item (whose index is ParentIndex); if specified to an invalid value, an error would occur and this operation would return -1. |
Return value
Long.
Returns the position of the new item if it succeeds and -1 if an error occurs. If any argument's value is null, returns null.
Usage
The menu separator is a horizontal line used to visually distinguish between groups of menu items. The separator can only be added in the master menu of RibbonApplicationMenu (AddMasterSeparatorItem) or in the menu of RibbonMenu (AddSeparatorItem); it cannot be added to the recent menu of RibbonApplicationMenu.
Examples
This example inserts a menu separator below the "Account" master menu item and inserts another menu separator in the submenu of "Account".
Long ll_Return, ll_Index RibbonApplicationMenu lr_AppMenu ll_Return = lr_AppMenu.AddMasterSeparatorItem() ll_Index = lr_AppMenu.InsertMasterItemFirst ("Account", "AccountBig!", "Ue_AccountMasterItemClicked") ll_Return = lr_AppMenu.AddMasterSeparatorItem (ll_Index)
See also