InsertTabButton
PowerScript function
Description
Inserts a tab button in the RibbonBar control.
Applies to
RibbonBar controls
Syntax
|
1 |
controlname.InsertTabButton ( Long ItemHandleAfter, String Text, String PictureName, String Clicked ) |
|
1 |
controlname.InsertTabButton ( Long ItemHandleAfter, RibbonTabButtonItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonBar control. |
|
ItemHandleAfter |
The handle of the tab button after which you want to |
|
Text |
The text that displays in the tab button. |
|
PictureName |
The name of the file that contains the picture. It will be |
|
Clicked |
The name of the Clicked user event to be bound with the |
|
Item |
A tab button item you want to insert. |
Return value
Long.
Returns the handle of the inserted item if it succeeds and -1 if an
error occurs. If any argument’s value is null, returns null.
Usage
The user events to be bound with the tab button must be defined
correctly according to the requirements of RibbonTabButtonItem. For
details, see Clicked in PowerScript Reference and Selected in PowerScript Reference.
Example 1
This example inserts a “TabButton2” tab button after the
“TabButton1” tab button and binds both buttons with the
“Ue_TabButtonClicked” user event.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Long ll_Handle, ll_Handle2 ll_Handle = rbb_1.InsertTabButtonFirst ("TabButton1", "ArrowUpSmall!", "Ue_TabButtonClicked" ) ll_Handle2 = rbb_1.InsertTabButton (ll_Handle, "TabButton2", "ArrowUpSmall!", "Ue_TabButtonClicked" ) //Ue_TabButtonClicked user event must have a long parameter for receiving the handle of TabButton //where the mouse is clicking. Refer to the Clicked property of RibbonTabButtonItem. //event type long ue_tabbuttonclicked(long itemhandle); //RibbonTabButtonItem lr_TabButton //rbb_1.GetTabButton(ItemHandle,lr_TabButton) //... //Return 1 //end event |
Example 2
This example inserts a “TabButton2” tab button after the
“TabButton1” tab button. It defines a tab button item with various
properties (including Text, Clicked, Selected etc.) and then inserts it
after the “TabButton1” tab button. The “TabButton1” tab button is bound
with the “Ue_TabButtonClicked” user event. The “TabButton2” tab button is
bound with the “Ue_TabButtonClicked” and “Ue_TabButtonSelected” user
events.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Long ll_Handle,ll_Handle2 RibbonTabButtonItem lr_TabButton ll_Handle = rbb_1.InsertTabButtonFirst("TabButton1","ArrowUpSmall!","Ue_TabButtonClicked") lr_TabButton.Text = "TabButton2" lr_TabButton.Clicked = "Ue_TabButtonClicked" lr_TabButton.Selected = "Ue_TabButtonSelected" ll_Handle2 = rbb_1.InsertTabButton(ll_Handle,lr_TabButton) //Ue_TabButtonSelected user event must have a long parameter for receiving the handle of TabButton //where the mouse is hovering over. Refer to the Selected property of RibbonTabButtonItem. //event type long ue_tabbuttonselected(long itemhandle); //RibbonTabButtonItem lr_TabButton //rbb_1.GetTabButton(ItemHandle,lr_TabButton) //... //Return 1 //end event |
See also