Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.net Preload forms

Status
Not open for further replies.

lawlegacy

IS-IT--Management
Jun 5, 2006
53
US
Is there a way to preload forms in vb.net? I need to load a form into memory without showing the form.

Thanks in advance!
 
What i would do:

-Declare (Public Dim f As FormName) in a module. If you use a class, then you can add the 'Shared' keyword in order not to have to init the class.

-Do like : f = New FormName
And then show it : f.Show()
(As f is Public and/or Shared, it can be accessed by anywhere in the project(s))
 
Well form.show causes the form to appear. I would like it to load it in the background.
 
Just don't call the .Show() or .ShowDialog() methods. Only init a new instance of the form.
 
Thank you!

I put all my loading code inside the new() contructor and it works now. Before I had it on the load event so it didn't execute the code until I called form.show

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top