Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Category:
Forms & Form designer
>>>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only