InsertLargeButtonFirst

Description

Inserts a large button as the first item in the panel of the RibbonBar control.

Applies to

RibbonBar controls

Syntax

controlname.InsertLargeButtonFirst ( Long PanelHandle, String Text, String PictureName, String Clicked )
controlname.InsertLargeButtonFirst ( Long PanelHandle, RibbonLargeButtonItem Item )

Argument

Description

controlname

The name of the RibbonBar control.

PanelHandle

The handle of the panel into which you want to insert a large button.

Text

The text that displays in the large button.

PictureName

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

Clicked

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

Item

A large button item to be inserted.


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 large button must be defined correctly according to the requirements of RibbonLargeButtonItem. For details, see Clicked and Selected.

Example 1

This example inserts the "Add" large button as the first item in the panel and binds it with the "Ue_LargeButtonClicked" user event.

Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_LargeButton

ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory")
ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!")
ll_Handle_LargeButton = rbb_1.InsertLargeButtonFirst (ll_Handle_Panel, "Add", "AddBig!", "Ue_LargeButtonClicked")

Example 2

This example defines a large button item with various properties (including binding with the "Ue_LargeButtonClicked" and "Ue_LargeButtonSelected" user events) and then inserts it as the first item in the panel.

Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_LargeButton
RibbonLargeButtonItem lr_LargeButton

ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory")
ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!")
lr_LargeButton.Text = "Add"
lr_LargeButton.PictureName = "AddBig!"
lr_LargeButton.Clicked = "Ue_LargeButtonClicked"
lr_LargeButton.Selected = "Ue_LargeButtonSelected"
ll_Handle_LargeButton = rbb_1.InsertLargeButtonFirst (ll_Handle_Panel, lr_LargeButton)

See also

InsertLargeButton

InsertLargeButtonFirst

InsertLargeButtonLast

DeleteLargeButton

SetLargeButton

GetLargeButton

GetChildItemByIndex