What is the difference between: Form.Dispose and Form.close. They both seem
to destroy the object. Or should both be called when closing a form? if so,
in what order?

Thanks

Re: Form.Dispose vs. Form.Close by Paul

Paul
Thu May 13 01:08:19 CDT 2004

"T Cordon" <tcordonb@hotmail.com> wrote in message
news:#hZAx1GOEHA.1608@TK2MSFTNGP12.phx.gbl...
> What is the difference between: Form.Dispose and Form.close. They both
seem
> to destroy the object. Or should both be called when closing a form? if
so,
> in what order?
>
> Thanks

Hi!

The difference between Form.Dispose and Form.Close is large:

Dispose destroy the object, and
Close simply close the form (send message - WM_CLOSE), without destroy.



Re: Form.Dispose vs. Form.Close by Justin

Justin
Thu May 13 01:41:38 CDT 2004

> Dispose destroy the object, and
> Close simply close the form (send message - WM_CLOSE), without destroy.

WM_CLOSE translates to WmClose() method on Form, which calls Dispose
under some circumstances. So the differences really aren't that large unless
you
are using validation and closing event cancellation logic.


--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers