Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Initially select all items in listbox.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00069682
Message ID:
00069715
Vues:
45
>Well, just shot a whole day attempting what seems to be a simple problem.
>
>Have a list box control with a SQL Select for the data in the control.
>
>I want to be able to have ALL items in the listbox inititally selected when the form is instantiated.
>
>I put code in the init event of the listbox
>FOR m.i = 1 TO THIS.Listcount
> THIS.Selected(m.i) = .T.
>ENDFOR
>
>and I can step through it and see the rows get selected but when the form is activated all of the selection disappears.
>
>thanks, kim

Kim, I don't know why it doesn't work in the INIT (I confirmed your code) but it DOES work in the REFRESH method. Perhaps you could call it from there with a user property that is changed from F to T after being called the first time? I'd call it "FormInitDone" or something like that.
If !thisform.FormInitDone
   FOR m.i = 1 TO THIS.Listcount
	THIS.Selected(m.i) = .T.
   ENDFOR
   thisform.FormInitDone = .T.
endif
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform