Skip to content

C# design problem

Paul Asd

Asked Nov 5, 2007, 10:37 PM EST3 answers
Share
LinkedInX
Im writing an application that edits a large amount of data structures. I have a problem with how to design the saving functionality.

Whenever the user changes a value, I want the program to recognize this, and ask the user if they want to save when they try to exit without saving.

The only way I can think to do it right now would be to have a boolean valueChanged which initializes to false, and is set to false whenever the user saves. Then have it set to true whenever an change has been made. Problem is, this would take quite a bit of work to integrate it with all the controls.

Is there a better way to do this?

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hello.

    I am in need of the same design solution.  I have a windows form with a tab control.  Each tab has lots of controls (textboxes and checkboxes) and I would like to be able to detect changes so I can just save those changes to my database.

    Please let me know if you come up with anything or get any help.  I need it bad!

    Daniel
    0
  • 0
    I know, its annoying. It wouldnt be so bad if I didnt have to add event handlers for every control to implement my solution.

    There has to be a better way.
    0
  • 0
    Nobody has any input/ideas on this topic? Someone here must have dealt with it sometime.
    0