Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Commandbutton with default = .T.
Message
De
27/05/1999 09:33:09
 
 
À
27/05/1999 08:55:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00223387
Message ID:
00223404
Vues:
23
>Hi
>
>I have a strange problem.
>
>I have a form with a pageframe that contains 6 pages. On one of the pages I have a commandbutton where Default = .T.
>
>When I leave a TextBox by pressing Enter (I'm not at the page with the descriped commandbutton), the commandbutton shows up on the current page and gets focus. !!!!
>
>Help, Help, Help...............

What is the problem? If a button's default property is set to .T., it is supposed to respond to the enter key being pressed anywhere on the form. This includes other pages. The effect of the button coming to the top is just a side affect-

If you want a button that only responds to the enter key being pressed when a certain page is active, you'll need to set Form.KeyPreview to .T., and code fot this is in the Form.Keypress event.

IF nKeyCode = 13 AND THISFORM.Pageframe.ActivePage = 2
THISFORM.PageFrame.Page2.OkButton.SetFocus()
THISFORM.PageFrame.Page2.OkButton.Click()
ENDIF
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform