ImageComboBox_SetItem Method
Description
This method sets the text, image, selected image and indent of the indicated item.
Parameters
- MyControlReference
- Reference to the control in the form of MyProject_MyForm_MyControl.
- ProjectFile
- String identifying the project as it was passed in LoadProject.
- DialogName
- String identifying the dialog by name.
- ControlName
- String identifying the control by name.
- nIndex
- Integer specifying the index where to add the item.
- sString
- String specifying the text of an entry to add.
- nImage
- Integer specifying the index of the image to use from the list attached to the control.
- nSelectedImage
- Integer specifying the index of the image to use from the list attached to the control when selected.
- nIndent
- Integer specifying the number of indent spaces to display for the item. Each indentation equals 10 pixels.
Return Values
Returns the following according to the situation:
- Integer indicating the index of the added item.
- Nil if the control is not found or does not support this function.
AutoLISP Syntax
The recommended convention is passing the control identifier directly:
Copy Code |
(Odcl_ImageComboBox_SetItem
MyControlReference [as Reference]
nIndex [as Integer]
sString [as String]
nImage [as Integer]
[Optional] nSelectedImage [as Integer]
[Optional] nIndent [as Integer]
) |
An alternative convention is to identify the control by providing the project file, the dialog name and the control name:
Copy Code |
(Odcl_ImageComboBox_SetItem
ProjectFile [as String]
DialogName [as String]
ControlName [as String]
nIndex [as Integer]
sString [as String]
nImage [as Integer]
[Optional] nSelectedImage [as Integer]
[Optional] nIndent [as Integer]
) |
Applies For
ImageCombo.
Example
Copy Code |
; Change the third item of the combobox
(Odcl_ImageComboBox_SetItem MyProject_MyForm_MyControl 2 "Grapefruit" 0 1) |
See Also
ImageComboBox_GetItem