I have a few questions regarding hidding vs closing forms. Is it bad
practice to close the current form when openning a new form? Does it create a
lot performance and memory issues? Is it better to use the Hide method
instead? And if I use the Hide method, is it true that I have to create
global variables for these forms, so that I could Show the hidden form from
another form?

RE: Questions regarding hidding vs closing forms by dotNetDave

dotNetDave
Mon Jan 24 11:09:07 CST 2005

I would not say it's a bad practice, especially if that Form is eatting up a
lot of memory. But, if it's used a lot in your appliation then I would just
hide it. As with any object, if you keep distroying it and re-creating it...
this will take time. This will also make your garbage collections slower too
because there is more to clean up.

Yes, you will have to create some type of application wide variable for the
Form if you want it used by another Form or just pass it into the second Form
in it's constructor, property or method.

Hope this helps.
David McCarter
www.vsdntips.com

"Teresa" wrote:

> I have a few questions regarding hidding vs closing forms. Is it bad
> practice to close the current form when openning a new form? Does it create a
> lot performance and memory issues? Is it better to use the Hide method
> instead? And if I use the Hide method, is it true that I have to create
> global variables for these forms, so that I could Show the hidden form from
> another form?

RE: Questions regarding hidding vs closing forms by Teresa

Teresa
Mon Jan 24 12:11:02 CST 2005

You've definitely helped. Thank you!

"dotNetDave" wrote:

> I would not say it's a bad practice, especially if that Form is eatting up a
> lot of memory. But, if it's used a lot in your appliation then I would just
> hide it. As with any object, if you keep distroying it and re-creating it...
> this will take time. This will also make your garbage collections slower too
> because there is more to clean up.
>
> Yes, you will have to create some type of application wide variable for the
> Form if you want it used by another Form or just pass it into the second Form
> in it's constructor, property or method.
>
> Hope this helps.
> David McCarter
> www.vsdntips.com
>
> "Teresa" wrote:
>
> > I have a few questions regarding hidding vs closing forms. Is it bad
> > practice to close the current form when openning a new form? Does it create a
> > lot performance and memory issues? Is it better to use the Hide method
> > instead? And if I use the Hide method, is it true that I have to create
> > global variables for these forms, so that I could Show the hidden form from
> > another form?