R
RvGrah
I'm using the Activated event of my form to run a database query in a
backroundWorker, and want to dismiss the call after the first time the
form is activated. Based on some excellent advice in an earlier post,
instead of maintaining a flag, I'm unsubscribing to this eventHandler.
My question is, why is this functional:
this.Activated -= new
System.EventHandler(Form1_Activated);
instead of:
this.Activated -= System.EventHandler(Form1_Activated);
Why would it be "new" when the event was newed in the form's creation
code? Don't you end up with a reference to a new delegate rather that
unsubscribing to the original?
Please enlighten me, all you smarter than me types. ;-)
Bob Graham
backroundWorker, and want to dismiss the call after the first time the
form is activated. Based on some excellent advice in an earlier post,
instead of maintaining a flag, I'm unsubscribing to this eventHandler.
My question is, why is this functional:
this.Activated -= new
System.EventHandler(Form1_Activated);
instead of:
this.Activated -= System.EventHandler(Form1_Activated);
Why would it be "new" when the event was newed in the form's creation
code? Don't you end up with a reference to a new delegate rather that
unsubscribing to the original?
Please enlighten me, all you smarter than me types. ;-)
Bob Graham