Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox woes
Message
From
28/12/2000 13:53:01
 
 
To
28/12/2000 13:19:38
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00457316
Message ID:
00457478
Views:
40
>>>>>I have a multi-selectable listbox on my form that I want to pre-fill when the form is loaded. I do this in the Init of the form, but by the time the form is activated the listbox has lost its values. Is there a better way of doing this? I don't know why it's losing its values.
>>
>>>>Are you using an array as your source? If so, it will lose scope when you leave the init of the form. Make the control source for the box an array that is a property of the form or a cursor.
>>
>>>Actually, the source is 6-Fields. It's coming straight from a table.
>>
>>Hello, Elyse.
>>
>>When you said that you pre-filled the listbox, we supossed that you were populating it item by item somehow.
>>
>>This have to work. Can you copy the init code? The only properties you have to set are: RowSource, RowSourceType, and Multiselect.
>
>Okay, I think I've narrowed down the problem, but I still can't solve it. My listbox loads properly with data from my table. I select multiple items and all is well. But if I deactivate and re-activate the form (i.e. by selecting another form and returning to the first one), the previously selected items in my listbox are no longer selected. How can I keep the items selected?

Oops! You're right! I checked this with the same result. I think it is something as a loss of focus from the form generates.

Personally, I don't like multiSelect listbox for its selection is too volatile. Beside your problem, you have to be very careful with the shift and ctrl keys to not alter your selection.

When I had to allow the user to select more than one record, I always preferred a grid with a checkbox. This is bulletproof and more obvious to me.

If you decide to go on with the listbox, I'm not sure that you can control this. In any case, tell me if I can help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform