Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to setfocus()?
Message
De
05/08/2004 23:14:07
 
 
À
05/08/2004 19:56:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00931180
Message ID:
00931215
Vues:
23
The correct button is marked (with a dot) but not highlighted (with a dotted box). So it's easy for the user to press the wrong one accidentally, say by pressing the spacebar.

>How about setting ThisForm.OpgMyOptionGroup.Value = (number) ?
>
>>I have a form with an option group which is programmatically set-up at runtime in the .init event.
>>I want the focus to be set to an option which is also determined at run-time. If I setfocus() to the option button during the .init() event the form immediately becomes visible which seems inelegant to me.
>>
>>Is there a better way in general of setting the control which is to receive initial focus at run-time? There are many examples of why you would want to do this, eg using the same form for adding a new record and editing an existing record. In the case of adding you would want the first user editable control (say a textbox) to be selected. In the case of editing you would want the OK button selected.
>>
>>My best solution so far is to set a form property flag in the init method and call setfocus in the form's gotfocus. However doing this strangely disables menus which are run in the gotfocus (or activate) in modal forms; which won't worry many folk but my app does that a lot.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform