Form Editing Events

  • Thread starter Thread starter Sir Psycho
  • Start date Start date
S

Sir Psycho

Hi,

I'm designing a form and I'd like to know when a control has been
edited. I know how to get around this, by putting code behind every
control to see if theres a change and then set a flag, but thats a
waste of time and a lot of code to write.

I can see someone having a much more elegant solution, I just can't
work it out. I was thinking of having every control inherit some
master control so I can have one peice of code that 'detects' when a
change has been made to any field or check box, just not sure how to
go about it.

Anyone have a nice and simple solution?

Thanks,
 
In your form load event, loop through your form's control collection and
dynamically add an event handler to each one that points to a single
method in your form.

In that single method, you can set a flag.

In total, that should be about 15-20 lines of code.
 
Back
Top