Hi all, i was wondering if you'd help me please. I'm creating an application in VB whereby I have plenty of radio buttons, textboxes, checkboxes, pictureboxes etc. The user can move pictureboxes around the screen etc, however I would my reset button to reset the form. I am working in Microsoft Visual studio 2008. I was wondering if someone knew how I could reset the whole form to it's original state, I.E so it is exactly the same apoperance like when I opened the file? Many thanks
Its a programming technique. Store every action into a collection of actions. Make sure every action is a base class or interface IAction. Then everything the user does, throw it on the list/collection of actions, then do the action of the last item on the list. Now you have an ordered list of specific actions the user did, and you can go back and forth or even all the way to the beginning but undoing all actions backwards. I advise getting the Head First Design Patterns book
Example sub origState radio1.value = "T" radio2.value = "T" end sub Once you need the restore the orig value just call the sub origState
ccoonen has stated the commonly used method for this purpose. As he also stated clearly, it is better to have a little idea on design patters for this. See Design Patterns Tutorial. Though the codes are C#, it will be easier for you to understand the logic. You may also see these video tutorials. See 15th tutorial.