Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formset focus
Message
 
À
02/09/2005 12:07:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01046240
Message ID:
01046285
Vues:
15
>
> when i initilised the form in the init event i wrote this.hide
>
> i try your ansewr but make same
>

No, I meant hiding the form that calls the second one

But You also could call the form with the NoShow-Clause
do form frm2.scx noShow name loForm2

....

loForm.Show()
I think, what You want to do is open a second form and directly on the second form set the
focus to, let's say, a textbox. Correct?

So, if You do something like this from within the Commandbutton
do form frm2.scx noShow name loForm2

....

loForm.Show()
loForm.Text1.SetFocus()
You will probably get an error "Can't setfocus from within 'click' or 'valid'" something like that. And that shows Your problem. So what You need to do is to get out of the button's Click-Event and AFTER that do the setfocus() (or activate).

So, what You need to do, is set a flag in the click() that You later check from the Button's LostFocus(). Because from the LostFocus you *can* set Focus to other objects.

Another approach is to employ a timer that fires only ONCE and then does the relocation of the focus. the timer's interval can be something like 20ms. Anything that allows the click to be finished.
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform