InsertComboBoxFirst
PowerScript function
Description
Inserts a combo box as the first item in the panel or group of the
RibbonBar control.
Applies to
Syntax
|
1 |
controlname.InsertComboBoxFirst ( Long ParentHandle, String SelectionChanged ) |
|
1 |
controlname.InsertComboBoxFirst ( Long ParentHandle, RibbonComboBoxItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonBar control. |
|
ParentHandle |
The handle of the panel or group in which you want to |
|
SelectionChanged |
The name of the SelectionChanged user event to be bound |
|
Item |
A combo box 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 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.
Example 1
This example inserts a combo box as the first item in a panel and
binds it with the “Ue_ComboBoxSelectionChanged” user event, and then
inserts another combo box as the first item in a group and binds it with
the same “Ue_ComboBoxSelectionChanged” user event.
|
1 2 3 4 5 6 7 8 9 |
Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_ComboBox, ll_Handle_Group 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_ComboBoxSelectionChanged") //Group ll_Handle_Group = rbb_1.InsertGroupLast (ll_Handle_Panel) ll_Handle_ComboBox = rbb_1.InsertComboBoxFirst (ll_Handle_Group, "Ue_ComboBoxSelectionChanged") |
Example 2
This example inserts the “MyComboBox” combo box as the first item in
a panel and binds it with the “Ue_ComboBoxSelectionChanged”,
“Ue_ComboBoxSelected”, and “Ue_ComboBoxModified” user events. It first
defines a combo box item with various properties (including Label,
PictureName, SelectionChanged, Selected, Modified etc.) and then inserts
it as the first item in a panel.
|
1 2 3 4 5 6 7 8 9 10 11 |
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!") lr_ComboBox.Label = "MyComboBox" lr_ComboBox.PictureName = "HelpSmall!" lr_ComboBox.SelectionChanged = "Ue_ComboBoxSelectionChanged" lr_ComboBox.Selected = "Ue_ComboBoxSelected" lr_ComboBox.Modified = "Ue_ComboBoxModified" ll_Handle_ComboBox = rbb_1.InsertComboBoxFirst (ll_Handle_Panel, lr_ComboBox) |
See also