Forms reloading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • charindal
    New Member
    • Dec 2009
    • 17

    Forms reloading

    I would like to know if it is possible to reload or re initialise a form and all its variables/objects to its original state. an example is as follows.

    i have a form with two public variables length and width. when the form is run for the first time it gets updated eg length set to 10 width to 20.. when in operation ther are some calculations that are done and the values of length, width changes. is it possible to call a method that remembers all the default values, including combo box states, datagridview states etc.
  • Joseph Martell
    Recognized Expert New Member
    • Jan 2010
    • 198

    #2
    We have an application that does something similar. Each form has a Controls collection that can be used to cycle through all of the elements of the form. With each of elements of the controls collection you could save the relevant information. You would have to figure out what type of control you are dealing with, but that is a pretty straight-forward matter.

    Its not simple or elegant, but it might work.

    Comment

    • charindal
      New Member
      • Dec 2009
      • 17

      #3
      I HAD TO DO IT THE LONG WAY I.E creating a constant variable for every other variable that i use. i also had to figure out the state of each combo box and list boxes. i then created a function that resets all states. i was hoping that if u load your form for the first time then you save that instance, you can always refer to it, how ever i noticed that it does not return the variable states at the time it was saved rather it throws the current values.

      Comment

      Working...