InsertTabButtonLast

Description

Inserts a tab button as the last item in the RibbonBar control.

Applies to

RibbonBar controls

Syntax

controlname.InsertTabButtonLast ( String Text, String PictureName, String Clicked )
controlname.InsertTabButtonLast ( RibbonTabButtonItem Item )

Argument

Description

controlname

The name of the RibbonBar control.

Text

The text that displays in the tab button.

PictureName

The name of the file that contains the picture. It will be displayed as 16*16.

Clicked

The name of the Clicked user event to be bound with the tab button. The Clicked user event for the tab button must have a long parameter for receiving the handle of the tab button. For details, see Clicked.

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 and Selected.

Example 1

This example inserts the "TabButton3" as the last tab button in the ribbon bar, and binds it with the "Ue_TabButtonClicked" user event.

Long ll_Handle
ll_Handle = rbb_1.InsertTabButtonLast ("TabButton3", "ArrowUpSmall!", "Ue_TabButtonClicked")

Example 2

This example inserts the "TabButton3" as the last tab button in the ribbon bar, and binds it with the "Ue_TabButtonClicked" and "Ue_TabButtonSelected" user events. It first defines a tab button item with various properties (including Text, PictureName, Clicked, Selected etc.) and then inserts it as the last tab button in the ribbon bar.

Long ll_Handle
RibbonTabButtonItem lr_TabButton

lr_TabButton.Text = "TabButton3"
lr_TabButton.PictureName = "ArrowUpSmall!"
lr_TabButton.Clicked = "Ue_TabButtonClicked"
lr_TabButton.Selected = "Ue_TabButtonSelected"
ll_Handle = rbb_1.InsertTabButtonLast(lr_TabButton)

See also

InsertTabButton

InsertTabButtonFirst

DeleteTabButton

SetTabButton

GetTabButton

GetTabButtonByIndex

GetTabButtonCount