GetItemCount
PowerScript function
Description
Determines the total number of items in a ribbon menu.
Applies to
RibbonMenu controls
Syntax
|
1 |
controlname.GetItemCount ( { Long ParentIndex } ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonMenu control |
|
ParentIndex |
The index of the menu item (RibbonMenuItem) whose submenu If not specified, the menu item will be counted; if |
Return value
Long.
Returns the total number of menu items in the menu. If the menu
contains no items, returns 0. If an error occurs, returns -1. If any
argument’s value is null, returns null.
Usage
A RibbonMenu control can contain menu items in no more than two
levels.
Examples
This example counts the menu item (which returns 1) and its submenu
items (which returns 2).
|
1 2 3 4 5 6 7 8 |
Long ll_Index, ll_Index2, ll_Count RibbonMenu lr_Menu ll_Index = lr_Menu.InsertItemLast ("MenuItem1", "AddSmall!", "Ue_MenuItem1Clicked") ll_Index2 = lr_Menu.InsertItemLast (ll_Index, "SubMenuItem1", "AddSmall!", "Ue_MenuItem11Clicked") ll_Index2 = lr_Menu.InsertItemLast (ll_Index, "SubMenuItem2", "AddSmall!", "Ue_MenuItem12Clicked") ll_Count = lr_Menu.GetItemCount (ll_Index) ll_Count = lr_Menu.GetItemCount () |
See also