InsertSmallButtonLast

Description

Inserts a small button as the last item in the panel or group of the RibbonBar control.

Applies to

RibbonBar controls

Syntax

controlname.InsertSmallButtonLast ( Long ParentHandle, String Text, String PictureName, String Clicked )
controlname.InsertSmallButtonLast ( Long ParentHandle, RibbonSmallButtonItem Item )

Argument

Description

controlname

The name of the RibbonBar control.

ParentHandle

The handle of the panel or group into which you want to insert the small button.

Text

The text that displays in the small 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 small button. The Clicked user event for the small button must have a long parameter for receiving the handle of the small button. For details, see Clicked.

Item

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

Example 1

This example inserts the "Add" small button as the last item in a panel and then inserts the "Add2" small button as the last item in a group. Both buttons are bound with the "Ue_SmallButtonClicked" user event.

Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_SmallButton, ll_Handle_Group

ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory")
ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!")
ll_Handle_SmallButton = rbb_1.InsertSmallButtonLast (ll_Handle_Panel, "Add", "AddSmall!", "Ue_SmallButtonClicked")
//Group
ll_Handle_Group = rbb_1.InsertGroupLast (ll_Handle_Panel)
ll_Handle_SmallButton = rbb_1.InsertSmallButtonLast (ll_Handle_Group, "Add2", "AddSmall!", "Ue_SmallButtonClicked")

Example 2

This example inserts the "Add" small button as the last item in a panel and binds it with the "Ue_SmallButtonClicked" and "Ue_SmallButtonSelected" user events. It first defines a small button item with various properties (including Text, PictureName, Clicked, Selected etc.) and then inserts it as the last item in a panel.

Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_SmallButton
RibbonSmallButtonItem lr_SmallButton

ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory")
ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!")
lr_SmallButton.Text = "Add"
lr_SmallButton.PictureName = "AddSmall!"
lr_SmallButton.Clicked = "Ue_SmallButtonClicked"
lr_SmallButton.Selected = "Ue_SmallButtonSelected"
ll_Handle_SmallButton = rbb_1.InsertSmallButtonLast (ll_Handle_Panel, lr_SmallButton)

See also

InsertSmallButton

InsertSmallButtonFirst

DeleteSmallButton

SetSmallButton

GetSmallButton

GetChildItemByIndex