>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