Description
Gets the tab button according to the index in the RibbonBar control.
Applies to
Syntax
controlname.GetTabButtonByIndex ( Long Index, ref RibbonTabButtonItem Item )
Argument |
Description |
---|---|
controlname |
The name of the RibbonBar control. |
Index |
The index of the tab button you want to obtain. |
Item |
A RibbonTabButtonItem variable in which you want to store the tab button 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
You can also get the tab button according to its handle using the GetTabButton function.
Example 1
This example inserts a "MyTabButton" tab button and then gets a copy of the tab button whose index number is 1.
Integer li_Return Long ll_Handle RibbonTabButtonItem lr_TabButton ll_Handle = rbb_1.InsertTabButtonFirst ("MyTabButton", "ArrowUpSmall!", "Ue_TabButtonClicked") li_Return = rbb_1.GetTabButtonByIndex (1, lr_TabButton)
Example 2
This example searches all tab buttons for the tab button whose tag value is "up".
String ls_path Long ll_TabCount, ll_I integer li_return RibbonTabButtonItem lr_Tab ls_path = "Saved Pictures\down.png" ll_TabCount = Rbb_1.GetTabbuttoncount( ) For ll_I = 1 To ll_TabCount If rbb_1.Gettabbuttonbyindex(ll_I, lr_Tab) = 1 Then If lr_Tab.tag = "up" Then lr_Tab.picturename = ls_path li_return = rbb_1.SetTabButton(lr_Tab.itemhandle, lr_Tab) End If End If Next
See also