This documentation is archived and is not being maintained.

Visual Basic Reference

Visual Studio 6.0

ListCount Property

See Also    Example    Applies To

Returns the number of items in the list portion of a control.



The object placeholder represents an object expression that evaluates to an object in the Applies To list.


ListCount provides specific information for each control:

  • ComboBox and ListBox controls the number of items in the list.

  • DirListBox control the number of subdirectories in the current directory.

  • DriveListBox control the number of drive connections.

  • FileListBox control the number of files in the current directory that match the Pattern property setting.

If no item is selected, the ListIndex property value is 1. The first item in the list is ListIndex = 0, and ListCount is always one more than the largest ListIndex value.