Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Setting Focus
Message
De
27/10/1998 21:48:23
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00151317
Message ID:
00151362
Vues:
27
>I'm just tearing my hair out with this one! I'm in VFP 5. I have 9 pages in a pageframe that represent different activities of clients. When data gets saved, I give the client the option to go back to the first page of data. When they say yes, I activate the 1st page with this: THISFORM.PAGEFRAME1.ACTIVEPAGE=1 This works, and from watching with the debugger it triggers the activate procedure for page 1. In the activate procedure I have the command: This.Text1.setfocus. Getting to the page works on the activepage command, but the focus just goes up to the tab title - not on text1. It DOES focus on text1 if the user clicks on the tab instead of using my programmatic option. What gives? This is the case everywhere, by the way, that I activate a page programmtically. I can't seem to set the focus to a particular object - and it matters very much that I do... Anyone got any ideas?
>
>TIA
>Diana

Hi Diana,
setting focus in the activate event of a page frame is problematic (as you've discovered). I think it's because foxpro continues to do stuff itself afterward. Setting focus to a grid in the activate event causes even worse problems with child/parent relations.
You could try playing in the page1.refresh code and setting focus there, but I image you will need some flag property or variable to prevent this firing all the time.
HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform