TiModeComboBox.AddItem

TiModeComboBox

Adds a single item to the Mode Combo Box.

function AddItem(Caption: String; Value : Integer);

Description

Call AddItem to add a single item to the Mode Combo Box. The Caption is the value that is displayed in the Combo Box. The Value is the value that is used to identify which item is currently selected in the combo box or to select that item using code.

For example, if you have specified an item with text "Sample Item" and have associated a value of "1" to that item, the Value property will be 1 if the "Sample Item" is selected in the Mode Combo Box. Also, if you set the Value property to 1, then the selected item in the combo box will change to "Sample Item".

Note: the values specified for the items added to the Mode Combo Box control do not need to be incremental or need to be in any particular order. Arbitrary values can be specified for any Mode Combo Box item. For most uses, simply use the default values for each item, incrementing by one with the first item starting at 0.

The control will accept duplicate values for items in the list, however this is discouraged unless you need to do this. If duplicate values are found in the list while setting the Value property, the first item found with the matching value will be selected.

Example

Delphi

iComponent.AddItem('Sample Item 1', 1);

C++ Builder

iComponent->AddItem("Sample Item 1", 1);

Contents | Index | Previous | Next