Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus to a sometimes control with a return f in whe
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00830922
Message ID:
00833023
Vues:
17
Hi Sergey.
Returning a .f. on when of a control(ControlA)never sets focus on the control, so a Set Focus from another control (ControlB)to this control has a problem finding it. The Set Focus from ControlB then Just stays there.

What I've done to overcome the problem is have another Control (A dummy Control) as the first control and a Keuboatd Return in the Got Focus.
I CAN then set focus to this dummy control and any subsequent controls behave as I want.

Regards,
Gerard



>Hi Gerard,
>
>It's not clear returning .T. or .F. from WHEN causes the problem?
>
>>I have following controls on a screen:
>>txtOptionalA
>>txtOptionalB
>>txtOptionalC
>>txtFld1
>>txtFld2
>>txtFld3 etc
>>cmdSave
>>
>>In the when of txtOptional fields , I have a condition which sometimes does not allow access to the control, depending on various parameters. Using If Mycondition Return .f.)
>>
>>On the Click of the cmdSave button, I have a Thsiform.txtOptionalA.SetFocus
>> because I always want to go to the top of the form, and if any of the buttons are not accessible, it should just go to the next one.
>>
>>The problem I have is that, in the cmdSave click, if the say txtOptionaA field returns a True on the When, the cmdSave Set Focus seems to fail, and focus stays on the cmdSave button.
>>
>>Any ideas on a way around this ?
>>
>>regards,
>>
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform