Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help - Problem making list items 'Selected' in code.
Message
From
02/10/1998 10:31:26
 
 
To
02/10/1998 10:03:59
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00143236
Message ID:
00143251
Views:
21
Hiya Bill ---

I found a workaround. Create a custom form property called SelectThem. Default it to .T. In the Refresh of the Form:
IF THIS.SelectThem
   THIS.List1.Selected(2)=.T.
   THIS.List2.Selected(3)=.T.
   THIS.SelectThem=.F.
ENDIF
This will do a one-shot on initializing the listbox.

>Can someone enlighten me on this simple problem:
>
>I have a list box. In the ListBox.Init I put the following code.
>
>this.Selected(2) = .T.
>this.Selected(3) = .T.
>this.Refresh
>
>When the form is run, list items 2 & 3 are not shown as selected. If I run the same code from a command button on the form, it works as expected - the list items are selected. I have tried putting the code in the form.Init and form.Activate as well, with no success. My goal is to have a multi-select listbox which can be initialized to show the currently chosen items as 'selected'.
>
>Thanks for any help.
>Bill Sabo
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform