ListCount Property

Applies To
ListBox, ComboBox

Description
Gets or sets the count of the number of items in a Listbox or Combobox.

Usage

GGet Form.Control.ListCount, var  
GSet  Form.Control.ListCount, value  
Form
Name of a form or string variable containing a form name.
Control
Name of a control or string variable containing a control name. The control must exist in the specified form.
var
Integer variable that will contain the value of the property.
value
Integer expression for the new value of the property.

Values
The number of items in the list.

Remarks
To clear the items in a ListBox or ComboBox, you can set ListCount to 0. If ListCount is set to a value that is higher than the number of items in the list, then empty text is added for the extra items.

See Also
ComboBox, ListBox, AddItem, List

Example

Integer count  
' Retrieve the number of items in a list  
GGet frmMain.lstPartNames.ListCount, count  
  
' Clear the items in a list  
GSet frmMain.lstPartName.ListCount, 0