G
Guest
Hello everybody,
I need to maintain whether data on a screen has been changed or not. If data
has been changed, then I need to give a pop-up warning on form close that
your unsaved data will be lost, do you wish to continue.
For performing this, I created a generic function which takes two arguments
of System.Windows.Forms.Form type. Then I iterate through all the controls
and perform one-to-one checking with textbox text property, listbox
selectedindex and so on. After performing this check, method return true or
false.
The main thing is that when something on the form chages, I need to create a
copy of the current state of the form in a form object. On close, call the
function supplying two arguments, one is the state that was saved and other
is the actual form that is this.
How do I save the state of the form, means when user types something or
perform any changes, I need to copy the form into another object with the
properties of data loaded in it.
Any ideas ??
I need to maintain whether data on a screen has been changed or not. If data
has been changed, then I need to give a pop-up warning on form close that
your unsaved data will be lost, do you wish to continue.
For performing this, I created a generic function which takes two arguments
of System.Windows.Forms.Form type. Then I iterate through all the controls
and perform one-to-one checking with textbox text property, listbox
selectedindex and so on. After performing this check, method return true or
false.
The main thing is that when something on the form chages, I need to create a
copy of the current state of the form in a form object. On close, call the
function supplying two arguments, one is the state that was saved and other
is the actual form that is this.
How do I save the state of the form, means when user types something or
perform any changes, I need to copy the form into another object with the
properties of data loaded in it.
Any ideas ??