ObjectDCL Banner

ImageComboBox_AddString Method

Description

This method will add a new item to the specified ImageCombo.

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.
sNewString
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.
nIndex
Integer specifying the index where to add the item.

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:

CopyCode imageCopy Code
(Odcl_ImageComboBox_AddString 
		MyControlReference [as Reference]
		sNewString [as String]
		nImage [as Integer]
		[Optional] nSelectedImage [as Integer]
		[Optional] nIndent [as Integer]
		[Optional] nIndex [as Integer]
	)

An alternative convention is to identify the control by providing the project file, the dialog name and the control name:

CopyCode imageCopy Code
(Odcl_ImageComboBox_AddString
		ProjectFile [as String]
		DialogName [as String]
		ControlName [as String]
		sNewString [as String]
		nImage [as Integer]
		[Optional] nSelectedImage [as Integer]
		[Optional] nIndent [as Integer]
		[Optional] nIndex [as Integer]
	)

Applies For

ImageCombo.

Example

CopyCode imageCopy Code
; Add to the combobox
(Odcl_ImageComboBox_AddString MyProject_MyForm_MyControl "Grapefruit" 0 1)

See Also

ImageComboBox_Clear, ImageComboBox_DeleteString, ImageComboBox_GetCount, ImageComboBox_GetItemData, ImageComboBox_SetItemData