RE: Questions regarding hidding vs closing forms

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: dotNetDave (dotNetDave_at_discussions.microsoft.com)
Date: 01/24/05


Date: Mon, 24 Jan 2005 09:09:07 -0800

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?



Relevant Pages

  • Re: How hard is socket programming?
    ... finds the page which still happens to be in memory and ... paged out on Windows 7 with 8.0 GB RAM. ... As far as I can tell FastCGI is good here ... one that has been established by long practice (the ...
    (microsoft.public.vc.mfc)
  • Re: How hard is socket programming?
    ... finds the page which still happens to be in memory and ... As far as I can tell FastCGI is good here too. ... considered valid until I talked to a linux expert ... one that has been established by long practice (the ...
    (microsoft.public.vc.mfc)
  • Re: How hard is socket programming?
    ... But note that at this point you have done measurement. ... finds the page which still happens to be in memory and ... As far as I can tell FastCGI is good here too. ... one that has been established by long practice (the ...
    (microsoft.public.vc.mfc)
  • Re: Short practice session
    ... the songs I have been working on lately, from memory. ... various tube amps in the basement and practice more like I am on a job. ... that time to develop new things that will stretch you, ...
    (rec.music.makers.guitar.jazz)
  • Re: Maintain list of attached event handlers (.Net 1.1)
    ... of memory is done when it is required/when it is convenient. ... That's why it is common practice to release ... tree and removes all of the handlers. ... BUT b) because I'm going to use a belt and braces approach. ...
    (microsoft.public.dotnet.framework)