Home All Groups Group Topic Archive Search About
Author
14 Jun 2010 3:10 PM
Mr. X.
Hello.
How can I override the destructor (I.e of PictureBox).

Thanks :)

Author
14 Jun 2010 11:59 PM
Herfried K. Wagner [MVP]
Am 14.06.2010 17:10, schrieb Mr. X.:
> How can I override the destructor (I.e of PictureBox).

Did you already try to override the 'Finalize' method?

Also note that Windows Forms controls implement the 'IDisposable' interface.

--
  M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
  V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
15 Jun 2010 5:41 AM
Mr. X.
Yes, I have tried override finalize method,
but when I did on program : myControl.Dispose(),
and put breakpoint on finalize method - I didn't reach that method.
Also I did after dispose : gc.collect(), and didn't reach the code neighter.

I will try IDisposable.

Thanks :)

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:hv6fo7$fl0$1@news.albasani.net...
> Am 14.06.2010 17:10, schrieb Mr. X.:
>> How can I override the destructor (I.e of PictureBox).
>
> Did you already try to override the 'Finalize' method?
>
> Also note that Windows Forms controls implement the 'IDisposable'
> interface.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>