Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Restore to Defaults Button
Message
From
15/02/2008 08:55:27
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
15/02/2008 08:39:23
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01292707
Message ID:
01292937
Views:
27
>>>>I have a form class and wondered what might be the best approach to put a button on it that would restore values when clicked to whatever they were when the form was first initialized. I can put such a button on an instance of that form and then have a list of things to reset depending on the values, but I would like to make it more generic if possible. Any way that makes sense to use SAVE and RESTORE or something like that? That seems so old school though.
>>>
>>>If the items in question are fields of a table, buffering makes this easy. Just use TableRevert().
>>>
>>>Tamar
>>
>>Already got that at the record/field level. Looking for something to reset form properties, variables and other stuff. Probably just have to make it form-specific. Thought it would be cool though.
>
>You should be able to do this at the class level. Add a property, either an array or a collection, to hold the list of items you want to be able to restore.
>
>Add a method, called from Init, where you populate that list. Add another method, called from Init, where you spin through the list and grab the initial values. Add a method, called by the Restore button, where you spin through the list and restore the values.
>
>For each form, the only thing you have to do is fill in the populating method.
>
>Tamar

Good ideas. I think this is along the lines of what I was trying to come up with.

I've not worked with a collection - or if I have, I've not known it - is that just a group of objects under another object?

UPDATE: Can I store references to form objects in a collection? Like "THISFORM.MyContainer.MyComboBox.Value" then have it restore that value?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform