Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Button
Message
De
10/12/2000 17:14:58
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Default Button
Divers
Thread ID:
00451407
Message ID:
00451407
Vues:
73
Hey Larry

How goes? Congrats on getting MVP. Here's a little VMP style problem and solution I've come up with. I've got my frmDEGridNav2Pages form with a Selection Criteria container on the first page. There's a button to trigger generating the view parameters and requerying the view.

I wanted to make the enter key click the button, so I initially set the button's DEFAULT property to .T. in the ctrSelCriteria.GotFocus and reset it to .F. in the ctrSelCriteria.LostFocus.

I gave up on that when I found that even though the LostFocus was firing and setting the Default to .F., the button remained the default even when I went to the next page. I even tried putting code in the pgfPageRefresh.CommonPageActivate to set the default to .F..

Anyways, what I finally did was to set THISFORM.KeyPreview to .T. and added some code in the form's KeyPress to check for an enter key and if the object obtained by oForms.RealActiveControl() was in my ctrSelCriteria. If that condition was met, I fired the method called by the button's click.

Strange but true.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform