Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't set Default button at run time
Message
From
27/04/1999 15:15:58
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00212505
Message ID:
00212677
Views:
29
>Yes, it'd be better to 'encapsulate' your code in the object you're trying to manipulate, it keeps things simple. So put the code in the refresh method for your button. And then on each from each pageframe activate event, call the button bars(not the individual button) refresh method. That should call the refresh method of all your buttons and make sure they reflect the current pageframe. I'm sure there's more coding involved here for you, but I hope that gets you going in the right direction.

Your suggestion about invoking the button refresh was helpful, but in this particular case, I can't figure out a way to implement it by encapsulating the code within the refresh itself. That's because all buttons will then eventually be set as the default on activate after you go to that page. And you can only have one button on a form as the default. So then the form doesn't know which button is the default, and I guess it just assumes the first one is. Because of that I really have to set the default property on/off in the page acti/deactivate event and reverse the process for the button on the other page.

But even doing trying it at the page level, it's not working quite right. I've been able to set the button on the first page as the default after clicking page activate. But I can't seem to get the button on the second page to be the default, even after setting the first button's default property to false in the first page Deactivate.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform