INKEY()

ListCount

This property tells you how many items are in a list or combo box. To our pleasant surprise, it works regardless of the method used for filling the list or combo.

Usage

nItems = oObject.ListCount
As the Help says, ListCount is a read-only property. You can look, but you can't touch. It's most useful for traversing the List or ListItem collection (or any of the collections associated with lists and combos, actually). Of course, in VFP 5 and later versions, you can use FOR EACH to do that, so you don't have to know how many items there are.

Example

* Tell the user how many choices there are WAIT WINDOW "You have " + ;             LTRIM(STR(ThisForm.lstMyList.ListCount)) + ;             "choices." NOWAIT

See Also

ComboBox, For Each, ListBox, List Property, ListItem


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net