Syntax 2: For ListBox and DropDownListBox controls
Description
Inserts an item into the list of values in a picture list
box.
Applies to
PictureListBox and DropDownPictureListBox controls
Syntax
|
1 |
listboxname.InsertItem ( item {, pictureindex }, index ) |
|
Argument |
Description |
|---|---|
|
listboxname |
The name of the PictureListBox or |
|
item |
A string whose value is the text of the item you |
|
pictureindex (optional) |
An integer specifying the index of the picture you |
|
index |
The number of the item in the list before which you |
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 lb_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 lb_actions and assigns it picture index 4:
|
1 |
plb_actions.InsertItem("Run Application", 4, 5) |
See also