Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.Selected() Method
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00035044
Message ID:
00035168
Vues:
36
>>I have a 2 page pageframe on my form. Page 1 is for data entry with index tag set to "Projects". Page 2 has a listbox based on fields for navigation purposes with index tag set to name. When the user moves from page1 to page2 I ensure that the correct item in the listbox is highlighted with the following code in the Page2.Activate() event:
>>
>>THISFORM.LockScreen=.T.
>>SET ORDER TO Name
>>mnrecno=RECNO()
>>COUNT ALL WHILE RECNO() # mnrecno TO mnoffset
>>THIS.lstPerson.Selected(mnoffset+1)=.T.
>>THISFORM.LockScreen=.F.
>>
>>(thanks to Matt Mcdonnell for the basis of this code)
>>
>>My problem is this. This works perfectly all the time EXCEPT for the first time. HELP!! Any ideas as to why?
>>
>>Thanks in advance --
>
>Just a quick stab in the dark because it's morning and I haven't had all my coffee yet. I see you've used the SET ORDER command to change the order. Is the DE loaded with this table? If so, what is the .Order property setting in it when the form loads. If the DE is loaded, you should change the .Order property rather than use SET ORDER.
>
>Steve Despres

I've had problems using the .Order property before and found it easier and less typing to use SET ORDER TO. Either way this isn't the problem. The code I'm using works perfectly except for the first time. I'm now assuming it has something to do with the timing of when the data is actually loaded into the listbox for the first time, but I'm not sure how to get around this.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform