Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox, rowsource 0, columncount 2
Message
 
 
À
17/10/2001 13:10:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00569537
Message ID:
00569769
Vues:
20
>The AddItem method really adds an entire row to the list. If the list has multiple columns and you use this syntax to add items to each column, the result is not what you would expect. When using the AddItem method to populate a combo or list, add the new item to the first column of each row using the syntax Control.AddItem( 'MyNewValue' ). Assign values to the remaining columns in that row using the syntax Control.List[Control.NewIndex, nColumn] = 'MyOtherNewValue'. The AddListItem method, however, does work as advertised.


Yes, thanks to all of your for the great help. I first thought (after reading the help) that AddItem and AddListitem are identical in their usage, overlooking the important detail of the difference between the item index and the item ID.

Both versions work fine (Control.AddItem + Control.List[Index,Column] and the Control.AddListItem), but the latter seems to be more straight in most situations where you never need to change items after they are added, and also easier to understand in code.
Christian Isberner
Software Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform