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,

Re: Form Editing Events by Bryan

Bryan
Wed Apr 25 09:45:20 CDT 2007

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.

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com
Web Site: http://www.composablesystems.net



"Sir Psycho" <totalharmonicdistortion@hotmail.com> wrote in message
news:1177510331.918705.153750@r30g2000prh.googlegroups.com:

> 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,