Dispose in Forms (VS 2005)

  • Thread starter Thread starter Alhambra Eidos Kiquenet
  • Start date Start date
A

Alhambra Eidos Kiquenet

Hi misters,



I noticed one thing that looked a little weird: The Dispose method goes into
the generated portion of the partial form.

Now, this might not be highly applicable to a Form (because you should be
putting resource control code in another class etc), but what if, for
whatever reason, you needed to put some code into the Dispose method?



Any suggestion about it ?



Thanks in advance, greetings.
 
Hello,

I can't personally think of another...

What code are you putting in the dispose method anyhow?

L
 
You could subscribe to Dispose event or add a custom component (class that
implements IComponent) to the form and it will be notified when form is
being disposed.
 
I agree, Dispose should not be in the *.designer.cs code. However,
it's only touched by VS200* when you create the form. AFAIK you can
freely edit code inside Dispose and the designer won't have a problem
or delete your code.
 
Back
Top