Syntax 2: For PictureListBox, DropDownPictureListBox,
RibbonComboBoxItem controls
Description
Inserts an item into the list of values in a picture list
box.
Applies to
PictureListBox, DropDownPictureListBox, and RibbonComboBoxItem
controls
Syntax
|
1 |
listboxname.InsertItem ( item {, pictureindex }, index ) |
|
Argument |
Description |
|---|---|
|
listboxname |
The name of the PictureListBox or DropDownPictureListBox |
|
item |
A string whose value is the text of the item you want to |
|
pictureindex (optional) |
An integer specifying the index of the picture you want |
|
index |
The number of the item in the list before which you want |
Return value
Integer. Returns the final position of the item. Returns -1 if an
error occurs. If any argument’s value is null, InsertItem returns
null.
Usage
If you do not specify a picture index, the newly added item will
not have a picture.
If you specify a picture index that does not exist, that number is
still stored with the picture. If you add pictures to the picture array
so that the index becomes valid, the item will then show the
corresponding picture.
For additional notes about items in ListBoxes and examples of how
the Sorted property affects the item order, see Syntax 1.
Examples
This statement inserts the item Run Application before the fifth
item in plb_actions. The item has no picture assigned to it:
|
1 |
plb_actions.InsertItem("Run Application", 5) |
This statement inserts the item Run Application before the fifth
item in plb_actions and assigns it picture index 4:
|
1 |
plb_actions.InsertItem("Run Application", 4, 5) |
These statements insert three items to the ribbon combo
box:
|
1 2 3 4 5 6 7 |
Integer li_Return RibbonComboBoxItem lr_ComboBox li_Return = lr_ComboBox.SetBoxPictureList("PaperSizeA0Small!,PaperSizeA1Small!") li_Return = lr_ComboBox.InsertItem("Item2",1,1) li_Return = lr_ComboBox.InsertItem("Item3",2,2) li_Return = lr_ComboBox.InsertItem("Item1",1) |
See also