Description
Sets the large button for the RibbonBar control.
Applies to
Syntax
controlname.SetLargeButton ( Long ItemHandle, RibbonLargeButtonItem Item )
Argument |
Description |
---|---|
controlname |
The name of the RibbonBar control. |
ItemHandle |
The handle of the large button on the same level that you will set. |
Item |
A large 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 large button. Refer to SetItem for the difference between SetItem and SetLargeButton.
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.
Examples
This example inserts the "Add" large button and binds it with the "Ue_LargeButtonClicked" user event, and then sets values for various properties (including Text, PictureName, Clicked, Selected etc.) of this large button.
Integer li_Return 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!") ll_Handle_LargeButton = rbb_1.InsertLargeButtonFirst (ll_Handle_Panel, "Add", "AddBig!", "Ue_LargeButtonClicked") li_Return = rbb_1.GetChildItemByIndex (ll_Handle_Panel, 1, lr_LargeButton) If li_Return = 1 Then lr_LargeButton.Text = "Delete" lr_LargeButton.PictureName = "DeleteBig!" lr_LargeButton.Clicked = "Ue_LargeButtonClicked2" lr_LargeButton.Selected = "Ue_LargeButtonSelected2" li_Return = rbb_1.SetLargeButton (lr_LargeButton.ItemHandle, lr_LargeButton) End If
See also