Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you select items in a listbox by value?
Message
From
14/12/2000 17:29:53
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00453572
Message ID:
00453658
Views:
21
Hi Brian

I have a similar problem in that I wanted my currently selected value to be highlighted in a list.

My list is populated by an array aMeasures. The current value I know is nMeasure which relates to the third column of the array. In the list itself I only display the first two columns.

So in the Init of the form I create the array as follows from a couple of tables

COPY TO ARRAY aMeasures ;
FIELDS cbmdes.DESCRIPTIO,gmt3.grm_w_aus,gmt3.meas_descr ;
REST WHILE gmt3.code_num=p2

My list (lstMeasures) has these properties set

RowSourceType=5
RowSource=aMeasures
ControlSource=nMeasure
BoundTo=.T.
BoundColumn=3

The item in the list is now highlighted and the .Value property of the list now gives me the new nMeasure value. So you don't need to know the Index of the item just let the list sort it out itself.

Hope this helps

Charlie
Previous
Reply
Map
View

Click here to load this message in the networking platform