>In my application, I have a single form which contains a pageframe where the bulk of data entry is done. I have a command button on the main form which is hidden. I have programmed this button with a case structure to behave in a specific manner depending on which page frame is active when the user hits the {ENTER} key. Usually, this behavior is to activate a command button on the tab which populates the screen with data. The case structure in the default button's Click() property is basically like the following
>DO CASE
> CASE PageFrame.ActivePage = 1
> CASE PageFrame.ActivePage = 2
> * do some processing; although I don't recommend calling
> the Click method of another control
> PageFrame.Page1.cmdDisplay.Click()
> CASE Pageframe.ActiveaPage = 3
> * do some processing; although I don't recommend calling
> the Click method of another control
> Pageframe.Page2.cmdDisplay.Click()
> ----- etc
>ENDCASE
>
>What I need to happen is when the ActivePage is the first tab, hitting ENTER does nothing. For the other tabs hitting enter should fire the default behavior. I have tried to set and rest the default button's Default property from .T. to .F. but when I trace with the debugger, the property resets to .T. at some point I have not been able to determine, but before my code resets the property to .T.
>
>What might I be missing? TIA
Richard,
I think I might be missing something.
Why can't you have a CASE that does absolutely nothing? When ActivePage = 1, simply add a comment to document that you are doing nothing and have CASE statements that actually do something for the rest of the pages. See above.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao