Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox, rowsource 0, columncount 2
Message
From
17/10/2001 13:59:09
 
 
To
17/10/2001 13:49:20
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00569537
Message ID:
00569781
Views:
26
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform