InsertComboBox
PowerScript function
Description
Inserts a combo box in the panel or group of the RibbonBar
control.
Applies to
Syntax
|
1 |
controlname.InsertComboBox ( Long ParentHandle, Long ItemHandleAfter, String SelectionChanged ) |
|
1 |
controlname.InsertComboBox ( Long ParentHandle, Long ItemHandleAfter, RibbonComboBoxItem Item ) |
|
Argument |
Description |
|---|---|
|
controlname |
The name of the RibbonBar control. |
|
ParentHandle |
The handle of the panel or group into which you want to |
|
ItemHandleAfter |
The handle of the item (check box, combo box, large |
|
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 after another combo box in a panel.
Both combo boxes are bound with the “Ue_ComboBoxSelectionChanged” user
event.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_ComboBox, ll_Handle_ComboBox2 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") ll_Handle_ComboBox2 = rbb_1.InsertComboBox (ll_Handle_Panel, ll_Handle_ComboBox, "Ue_ComboBoxSelectionChanged") //Ue_ComboBoxSelectionChanged user event must have two long parameters for receiving the handle and //index number of the selected ComboBox. //event type long ue_comboboxselectionchanged(long itemhandle, long index); //Integer li_Return //String ls_Text // //RibbonComboBoxItem lr_ComboBox //li_Return = rbb_1.GetComboBox(ItemHandle,lr_ComboBox) //If li_Return = 1 Then // ls_Text = lr_ComboBox.Text(Index) //End If // //Return 1 //end event |
Example 2
This example inserts the “MyComboBox2” combo box after another combo
box in a panel and binds it with “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 after another combo box.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
Long ll_Handle_Category, ll_Handle_Panel, ll_Handle_ComboBox, ll_Handle_ComboBox2 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_ComboBoxSelectionChanged") lr_ComboBox.Label = "MyComboBox2" lr_ComboBox.PictureName = "HelpSmall!" lr_ComboBox.SelectionChanged = "Ue_ComboBoxSelectionChanged" lr_ComboBox.Selected = "Ue_ComboBoxSelected" lr_ComboBox.Modified = "Ue_ComboBoxModified" ll_Handle_ComboBox2 = rbb_1.InsertComboBox (ll_Handle_Panel, ll_Handle_ComboBox, lr_ComboBox) //Ue_ComboBoxModified user event must have a long parameter for receiving the handle //of ComboBox that is changed. //event type long ue_comboboxmodified(long itemhandle); //RibbonComboBoxItem lr_ComboBox //rbb_1.GetComboBox(ItemHandle,lr_ComboBox) ////... // //return 1 //end event //Ue_ComboBoxSelected user event must have a long parameter for receiving the handle //of ComboBox where the mouse is hovering over. //event type long ue_comboboxselected(long itemhandle); //RibbonComboBoxItem lr_ComboBox //rbb_1.GetComboBox(ItemHandle,lr_ComboBox) ////... // //return 1 //end event |
See also