SetComboBox
PowerScript function
Description
Sets the combo box for the RibbonBar control.
Applies to
Syntax
|
1 |
controlname.SetComboBox ( Long ItemHandle, RibbonComboBoxItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonBar control. |
|
ItemHandle |
The handle of the item (check box, combo box, large |
|
Item |
A combo box 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 combo box. Refer to SetItem for the difference between SetItem and SetComboBox.
The user events to be bound with the combo box must be defined
correctly according to the requirements of RibbonComboBoxItem. For
details, see Modified in PowerScript Reference, Selected in PowerScript Reference, and SelectionChanged in PowerScript Reference.
Examples
This example inserts a combo box and binds it with the
“Ue_ComboBoxClicked” user event, and then sets values for various
properties (including Label, PictureName, SelectionChanged, Selected,
Modified etc.) of the combo box.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
Integer li_Return Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_ComboBox RibbonComboBoxItem lr_ComboBox ll_Handle_Category = rbb_1.InsertCategoryFirst ("MyCategory") ll_Handle_Panel = rbb_1.InsertPanelFirst (ll_Handle_Category, "MyPanel", "AddSmall!") ll_Handle_ComboBox = rbb_1.InsertComboBoxFirst (ll_Handle_Panel, "Ue_ComboBoxClicked") li_Return = rbb_1.GetChildItemByIndex (ll_Handle_Panel, 1, lr_ComboBox) If li_Return = 1 Then lr_ComboBox.Label = "MyComboBox2" lr_ComboBox.PictureName = "HelpSmall!" lr_ComboBox.SelectionChanged = "Ue_ComboBoxSelectionChanged" lr_ComboBox.Selected = "Ue_ComboBoxSelected" lr_ComboBox.Modified = "Ue_ComboBoxModified" li_Return = rbb_1.SetComboBox (lr_ComboBox.ItemHandle, lr_ComboBox) End If |
See also