Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help populating a listbox
Message
De
23/10/2002 09:19:17
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Help populating a listbox
Divers
Thread ID:
00714319
Message ID:
00714319
Vues:
52
I'm trying to populate a listbox that has three columns. I set its columncount=3 and since I don't care to see the third column (but need it) I set the columnwidths="100,80,0". I want the list to be sorted by column 1 (some names) and items in it need to be able to be removed and/or added.

Now I populate the list by scanning thru a cursor and issuing three AddListItems - one for each column. This works and the list functions exactly as I require, but, it takes much longer to populate than if I were to instead set the list's RowSourceType=3 (SQL statement) and its RowSource to a string containing the select statement that generated the cursor that I was scanning thru.

Why is the latter so much faster? I've experimented with the list's sorted property when populating it with the first method but its slow either way. Also, when I populated the list using the SQL statement, I couldn't add or remove items using AddListItem or RemoveItem. So although it may be very fast to populate and display, its useless for my needs.

Anyone have suggestions as to how I may get a listbox to display its contents quickly and function the way I want?

TIA

Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform