Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multi select listbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01038027
Message ID:
01038340
Vues:
24
Hi Geoff,

I actually just remembered, that Mike Asherman who designed that class originally had some special code in listbox when and other events. But may be it would be easier to you to go with multiselect grid instead. Check out Cetin Basoz class and my Container with Multiselect grid class here in Downloads area. Perhaps it can suit your needs.

>Hi Naomi
>
>I tried putting it into a container early but this had no effect. Also, there is a problem when the control receives focus, which is probably the whole problem really. I found that it was losing its settings. It is almost as though changing the setting doesnt hold past the local events but that is a wild guess.
>
>GotFocus resetting of the values fixes this.
>
>Regards
>Geoff Scott
>
>>>I am trying to set the selected items in a listbox upon entry to a form.
>>>
>>>In the Init event I have the following

>>>
>>>That is your problem. This is a known bug and is documented in MSDN:
>>>
>>>BUG: Using Selected Method in Init Event Does Not Work
>>>
>>>This article was previously published under Q177340
>>>
>>>SYMPTOMS
>>>In Visual FoxPro versions 5.x, programmatically using the Selected method to select an item in a list box does not work in the Init method of a list box or a form.
>>>
>>>If I were you, I would do this in the form's Activate the first time it si activated. Just add a form property called lFirstTime to your firm and initialize it to .T.
>>>
>>>Then, you can check its value in the form activate, select the appropriate items in your listbox the first time in, and set the form's lFirstTime property to .F.
>>
>>Hi Marcia,
>>
>>It works in our environment (VFP6+). The multiselect listbox is in the Container (it's a complicated class) and the code to set selections is called from form's Init.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform