Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddItem and ListBoxes
Message
From
03/08/1999 06:29:42
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
03/08/1999 04:23:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00249129
Message ID:
00249136
Views:
32
>I'm using a ListBox with RowSourceType of 0-None and so it needs to be populated with the lstBox.AddItem() method. My question is this: I can't figure out how (if it's even possible) to add a 2nd column to this. It doesn't seem to be working for me. I've tried this:
>
>THIS.AddItem('FirstOne', 1, 1)
>THIS.AddItem('2ndColumn', 1, 2)
>
>and this one:
>
>THIS.AddItem('FirstOne', 1,1, '2ndColumn', 1,2)
>
>Neither method apparently works. BTW, I have to use RowSourceType = 0 because this ListBox needs to use mover-bars.
>
>TIA,
>-Bonnie

Hi Bonnie,

I struggled with this a while ago. Here's what I have.

To initially populate the lists, use something like :-

SELECT CursorWithItems
SCAN
THISFORM.lstSource.Additem(Col1Text)
lnIndex = THISFORM.lstSource.NewIndex
THISFORM.lstSource.List(lnIndex,2) = Col2Text
ENDSCAN

If you need to delete individual items (like in a mover) you only need to delete once - i.e.

loList.RemoveItem( lnIndex)

HopeItHelps
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Reply
Map
View

Click here to load this message in the networking platform