Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List box
Message
From
29/01/2008 09:30:01
 
 
To
28/01/2008 18:33:30
Randy Hooper
Ranco Business Software
Tampa, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01286399
Message ID:
01286591
Views:
16
>Have a local view and I am wanting to populate a list box with 3 columns. Code I am using,
>
>
>scan
>   citem1 = alltrim(field1)
>   citem2 = alltrim(field2)
>   citem3 = alltrim(field3)
>
>   thisform.list1.addItem(citem)
>
>   ** how do i add to my code to add citem2, citem3 to the list box
>endscan
>
>

Use the AddListItem method to populate columns other than the first. AddItem _always_ adds a new row; the others do not. Use the NewItemId property to fill in the row you just added:
scan
   citem1 = alltrim(field1)
   citem2 = alltrim(field2)
   citem3 = alltrim(field3)

   thisform.list1.addItem(citem)
   thisform.list1.addListItem(cItem2, ThisForm.List1.NewItemID, 2)
   thisform.list1.addListItem(cItem3, ThisForm.List1.NewItemID, 3)
endscan
Tamar
Previous
Reply
Map
View

Click here to load this message in the networking platform