Taken this is Windows Forms, you can use
Control.Enabled Property (System.Windows.Forms)[
^] to enable or disable the control.
What comes to the edited data. Add a new boolean variable to your program, for example
bool changesSaved;
Once you save the changes, set it to
true
. Also wire
Control.TextChanged Event (System.Windows.Forms)[
^] and in that event set the
changesSaved
to
false
. Now when needed you can investigate ig the changes have been changed or not. Just remember to set the initial value correctly for example if you read the data from a file.