Dispose in Forms (VS 2005)

  • Thread starter Alhambra Eidos Kiquenet
  • 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.
 
L

Leo Seccia

Hello,

I can't personally think of another...

What code are you putting in the dispose method anyhow?

L
 
P

pagerintas pritupimas

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.
 
J

JS

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top