Returns the number of prompts in a listbox, or the number of items in a tree.

Syntax

<oRef>.count( )

<oRef>

An object reference to the listbox or tree whose items to count.

Property of

ListBox, TreeView

Description

Use a listbox’s count( ) method when you can't anticipate the number of prompts a listbox might have at runtime. For example, when you specify "FILE *.*" for the dataSource property, the number of prompts depends on the number of files in the current directory.

When using an array as the dataSource for a listbox, you can check the array’s size property to get the number of items.

The tree view’s count( ) method returns the total number of items in the entire tree, even if they are not displayed or hidden in a collapsed subtree. Use the visibleCount( ) method to count the items that are visible in the tree view.