Solved

Initialize All forms in a VB.NET application at Startup

Posted on 2007-03-28
3
278 Views
Last Modified: 2013-11-27
I am developing a program in Visual Studio 2005. There will be more than 50 forms. I was wondering if it a good idea to initialize all forms in a module and define a Sub Main and show the first form.
For example
in Module InitializeForms
Public frmMain1 as new frmMain
.....etc

Sub Main
frmMain.showdialog
end Main
End Module

Any suggestions/ideas would be greatly appreciated.
0
Comment
Question by:vamshi25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
shahprabal earned 25 total points
ID: 18810363
Initializing the forms upfront will take up a lot of memory and possibly increase the start time... even though you have 50 forms if only one or two are going to be up at one time then it (how many forms the application has) wont make any difference if you initialize the forms as needed cause you are only initializing one or two forms at a time.

HTH
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 25 total points
ID: 18810865
It would just be a waste of memory.  .Net is already a memory hog...why give it more stuff to load?

I agree with shahprabal...there is rarely ever a time when you need to "preload" 50 forms...the user can't deal with that many at once.  =)
0
 

Author Comment

by:vamshi25
ID: 18810967
Thank you shahprabal and Idle_Mind for prompt reponses and explaining the memory wastage part.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question