Skip to content

AddItem Method

Description

Adds an item to the list box 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 list box.
  • Index: Integer specifying the position within the object where the new item or row is placed. For the first item in a list box control, the index is 0.
  • Data: Data for the new item.

Remarks

If you supply a valid value for index, the item is placed at that position within the list box. 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


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.