AddItem Method
Description
Adds an item to the combobox control.
Syntax
Public Sub AddItem( _
ByVal Item As String, _
Optional ByVal Index As Variant, _
Optional ByVal Data As Variant _
)
Parameters
- Item: Text string of the item to add to the combobox.
- Index: Integer specifying the position within the object where the new item or row is placed. For the first item in a ComboBox control, the index is 0.
- Data: Sets the ItemData for the item.
Remarks
If you supply a valid value for index, the item is placed at that position within the combobox. If index is omitted, the item is added at the proper sorted position (if the Sorted property is set to True) or to the end of the list (if Sorted is set to False).
See Also
- ComboBox Control
- ItemData Property
- ItemExtraString Property
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.