Link to home
Start Free TrialLog in
Avatar of Dee
DeeFlag for United States of America

asked on

How to get the value of a particular column in a mult column list box?

How do I get a value from a particular column of the selected row in multi column list box in VFP?

v = thisform.myListBox... ?  Value of column 2
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

The Listbox contents is available in the List property. This property is represented by array so you can access each element of the listbox.

So Value of column 2 in row 1:

v = thisform.myListBox.List[1, 2]

If you need to go through all items in the Listbox use loop from 1 to thisform.myListBox.ListCount
Avatar of Dee

ASKER

Thanks.  

I need the value of column2 of the selected row. I can't seem to find the syntax for that.

v = thisform.myListBox.List[selectedRowNum, 2]
Avatar of Dee

ASKER

listitemID gives me the selected row.

nIndex = thisform.lstProcs.listitemid && ID of the item
v = thisform.lstProcs.List[nIndex, 2]

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Dee
Dee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial