Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddItem and ListBoxes
Message
 
To
03/08/1999 04:23:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00249129
Message ID:
00249268
Views:
24
Bonnie,

AddItem does not do multiple columns. AddListItem does. The other difference is that AddItem refernces the index (or position in the list) while AddListItem references the itemID (absolute unique identifier) of the item.

The potential problems with using literal values wiuth either of these methods is that you can accidentally overwrite another item rather than adding the new item to the list if you inadvertently reuse the same ItemIndex;
This.AddItem("Apples",1,1)
This.AddItem("Oranges",1,1)
The above will create a list with 1 item in it, Oranges.
This.AddItem("Apples",This.ListCount+1,1)
This.AddItem("Oranges",This.ListCount+1,1)
Now to get two columns just switch to the AddListItem method;
This.AddListItem("Apples",This.NewItemID+1,1)
This.AddListItem("Red",This.NewItemID,2)
This.AddListItem("Apples",This.NewItemID+1,1)
This.AddListItem("Green",This.NewItemID,2)
Previous
Reply
Map
View

Click here to load this message in the networking platform