1. Create a new form and add a listbox.
2. Set ColumnCount = 3
3. Set ColumnWidths to 110,110,110
4. Put the following code in FORM init Event:
FOR lni = 1 TO 3
DO CASE
CASE lni = 1
lcValue = "Mickey"
CASE lni = 2
lcValue = "Donald"
OTHERWISE
lcValue = "Goofey"
ENDCASE
THISFORM.list1.ADDLISTITEM(lcValue + " A ",lni,1)
THISFORM.list1.ADDLISTITEM(lcValue + " B ",lni,2)
THISFORM.list1.ADDLISTITEM(lcValue + " C ",lni,3)
ENDFOR
5. Add a button
6. Place the following code in the click event of the button:
FOR lni = 1 TO THISFORM.list1.LISTCOUNT
MESSAGEBOX(THISFORM.list1.LISTITEM(lni,1))
MESSAGEBOX(THISFORM.list1.LISTITEM(lni,2))
MESSAGEBOX(THISFORM.list1.LISTITEM(lni,3))
ENDFOR
THISFORM.RELEASE
7. Save and execute the form.
This demonstrates how you can programmatically load the items, and then reference them individually.
If you would like to see how to take the multi-column list items from this item, and move them to another multi-column list continue with step 8.
8. Add another listbox to the form. It probably has the name of list2.
9. In the double-click event of list1, add the following code:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.