次の方法で共有


ListItemID Property

Specifies the unique ID number for the selected item in a ComboBox or ListBox control. Not available at design time; read-write at run time.

Control.ListItemID[ = nItemID]

Property Values

  • nItemID
    The settings and interpretations for the ListItemID property are:
    Setting Description
    – 1 Indicates no items selected. For a combo box, it means that the user has entered a value not in the list.
    1 (or any number greater than 1) The item ID of the selected item.

Remarks

If an item is removed from a list using the RemoveListItem method, all remaining items retain their unique identification numbers. When an item is added to a list using the AddItem method, and the Sorted property is set to false (.F.), nItemID is assigned the lowest number available. When an item is added to a list using the AddListItem method, and the Sorted property is set to false (.F.), you can assign any number to nItemID.

The ListItemID property is also set when the SelectedID property on a Listbox control is set.

See Also

AddItem Method | AddListItem Method | IndexToItemID Method | ItemIDToIndex Method | ListCount Property | List Property | ListItem Property | RemoveItem Method | RemoveListItem Method | SelectedID Property

Applies To: ComboBox | ListBox