Determines the total number of items.
Description
Determines the total number of items in a ribbon menu.
Applies to
Syntax
controlname.GetItemCount ( { Long ParentIndex } )
Argument |
Description |
---|---|
controlname |
The name of the RibbonMenu control |
ParentIndex |
The index of the menu item (RibbonMenuItem) whose submenu items you want to count. If not specified, the menu item will be counted; if specified to a valid value, the submenu items of the menu item (whose index is ParentIndex) will be counted; if specified to an invalid value, an error would occur and this operation would return -1. |
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).
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
Description
Gets the count of items in the table of contents.
Applies to
PDFTableOfContentsItem objects
Syntax
long GetItemCount()
Return value
Long. If calling the function for the PDFTableOfContents object, returns the count of items (level-1 chapters) in the table of contents. If calling the function for a PDFTableOfContentsItem object, returns the count of sub-level items in the PDFTableOfContentsItem.
Example
The following example gets the count of items (level-1 chapters) in the table of contents.
Long ll_count ll_count = lpdf_toc.getitemcount( )
See also
Description
Gets the count of item in the object.
Applies to
Syntax
long GetItemCount()
Return value
Long. Returns the count of items if it succeeds, or returns null if otherwise.
Example
The following code example gets the count of items in the PDFFormFieldComboBox object lpdf_combobox.
long ll_count ll_count = lpdf_combobox.getitemcount()
See also