Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hilighting current record in list?
Message
 
À
09/07/1997 04:01:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00038930
Message ID:
00039097
Vues:
33
>>I have a 2 page pageframe on my data entry form. Page1 has all the fields for data entry and Page2 has a listbox of all entered records for easy navigation. To hilight the current record in the listbox I have the following code in Page2's .Activate method:
>>
>>THISFORM.Lockscreen=.T.
>>mnrecno=RECNO()
>>COUNT ALL WHILE RECNO()#mnrecno TO mnoffset
>>THIS.lstCourse.Selected(mnoffset+1)=.T.
>>THISFORM.rtgPageFrame1.Page2.Refresh
>>THISFORM.Lockscreen=.F.
>>
>>This works every time except for the first time Page2 is Activated. The first time nothing is hilighted. If I click on page2, then page1, and then back to page2 the current record is hilighted.
>>
>>Any ideas are greatly appreciated.
>
>Colin,
>
>In an equivalent situation I remember trying something like:
>
> PageFrame1.Page2.MyListConstrol.SetFocus

Thanks Francois. I moved all the code from the Page2.Activate method to the lstCourse.GotFocus method changing the line THIS.lstCourse.Selected(mnoffset+1)=.T. to THIS.Selected(mnoffset+1)=.T. and putting the line THIS.lstCourse.SetFocus into the Page2.Activate method and this works perfectly.

I have discovered a new problem though. Say for example the listbox can show 10 records at a time and I am on the 20th record. When I click on Page2 the 20th recorde is .Selected, however the user won't know this because it is not visible in the listbox. How do I ensure that when the user selects Page2 the set of records shown in the listbox will include the .Selected one? I have tried Refresh and Requery with no results.
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