?
Solved

Initialize All forms in a VB.NET application at Startup

Posted on 2007-03-28
3
Medium Priority
?
287 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 75 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 75 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

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

800 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