Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't set Default button at run time
Message
From
28/04/1999 13:38:07
 
 
To
27/04/1999 11:37:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00212505
Message ID:
00213070
Views:
34
>I seem to have the opposite problem of several I've seen relating to the default button: namely, I intentionally begin with default set to .F. for all my buttons, but then when then in the Activate of a page on my page frame, want to set the save button .T. so that Enter works in typical Windows behavior (I want to be able to set the default to one button on page 1 and a different when I click on page 2). Problem is, I can't get it to work, i.e. I set the button's default property to .T., then checked the value which shows as .T., but it doesn't 'work as coded'. I've tried refreshing the page the button is on, and the form, to no avail.
>
>Any ideas on this?
>
>Thanks,
>
>Sylvia

Hi Sylvia,
I built a demo form with a pageframe that sets the Default property of the cmdSave control on the active page to .T. (all others .F.) when the Activate event occurs. It works correctly.
Basically, I created a three page pageframe. On each page I placed one textbox txtDummy and one command button cmdSave. I set the tab order to be txtDummy, cmdSave. Next in each page's Activate I added the code:
This.Parent.ActivatePage(This)
I added the method ActivatePage to the parent pageframe class:

LPARMETERS poPage
WITH This
ENDWITH
Ned

Reality is.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform