Description
Gets the child item in a parent (Category, Panel, or Group) according to its index in the RibbonBar control.
Applies to
Syntax
controlname.GetChildItemByIndex ( Long Handle, Long Index, ref PowerObject Item )
Argument |
Description |
---|---|
controlname |
The name of the RibbonBar control. |
Handle |
The handle of the parent item whose child item you want to obtain. The parent item can be Category, Panel, or Group. |
Index |
The index of the child item you want to obtain. |
Item |
An item variable in which you want to store the child item identified by the index. |
Return value
Integer.
Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is null, returns null.
Usage
The parent object can be Category, Panel, or Group.
The child item for Category is Panel; the child item for Panel can be Group, LargeButton, SmallButton, CheckBox, and ComboBox; the child item for Group can be SmallButton, CheckBox, and ComboBox.
Examples
This example gets a copy of the "MySmallButton" small button from
the "MyPanel" panel and stores it in the lr_SmallButton
variable.
Long ll_CateGoryHandle, ll_PanelHandle, ll_SmallButtonHandle Integer li_return, li_return2 RibbonPanelItem lr_Panel RibbonSmallButtonItem lr_SmallButton PowerObject lpo_Object ll_CateGoryHandle = rbb_1.InsertCategoryFirst ("MyCategory") ll_PanelHandle = rbb_1.InsertPanelFirst (ll_CateGoryHandle, "MyPanel", "TabsSmall!") ll_SmallButtonHandle = rbb_1.InsertSmallButtonFirst (ll_PanelHandle, "MySmallButton", "EmployeeSmall!", "ue_ButtonClicked") li_return = rbb_1.GetChildItemByIndex (ll_CateGoryHandle, 1, lr_Panel) If li_Return = 1 Then li_return2 = rbb_1.GetChildItemByIndex (lr_Panel.ItemHandle, 1, lpo_Object) If li_return2 = 1 And lpo_Object.ClassName() = "ribbonsmallbuttonitem" Then lr_SmallButton = lpo_Object End If End If
See also