Description
Sets the small button for the RibbonBar control.
Applies to
Syntax
controlname.SetSmallButton ( Long ItemHandle, RibbonSmallButtonItem Item )
Argument |
Description |
---|---|
controlname |
The name of the RibbonBar control. |
ItemHandle |
The handle of the small button on the same level that you will set the item. |
Item |
A small button item you are setting. |
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 use the SetItem function to set the small button. Refer to SetItem for the difference between SetItem and SetSmallButton.
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.
Examples
This example inserts the "Add" small button and binds it with the "Ue_SmallButtonClicked" user event, and then sets new values for various properties (including Text, PictureName, Clicked, Selected etc.) of this small button.
Integer li_Return 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!") ll_Handle_SmallButton = rbb_1.InsertSmallButtonFirst (ll_Handle_Panel, "Add", "AddSmall!", "Ue_SmallButtonClicked") li_Return = rbb_1.GetChildItemByIndex (ll_Handle_Panel, 1, lr_SmallButton) If li_Return = 1 Then lr_SmallButton.Text = "Delete" lr_SmallButton.PictureName = "DeleteSmall!" lr_SmallButton.Clicked = "Ue_SmallButtonClicked2" lr_SmallButton.Selected = "Ue_SmallButtonSelected2" li_Return = rbb_1.SetSmallButton (lr_SmallButton.ItemHandle, lr_SmallButton) End If
See also