Loading Windows Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to load a windows form into memory without showing it. You
used to be able to do this in the god old days.

TIA
 
Dim MyForm as New MyFormClass

(it's hidden until you either:)

MyForm.Show
MyForm.ShowDialog
 
Robin,
Dim MyForm as New MyFormClass

(it's hidden until you either:)

MyForm.Show
MyForm.ShowDialog

You probably mean to make a module with a sub main in it with this code?

Cor
 
Cor,

Cor Ligthert said:
You probably mean to make a module with a sub main in it with this code?

It doesn't really matter where you place the code... :-).
 
Herfried,

What you think of this

Private sub MyFormClass_load etc

Dim MyForm as New MyFormClass
(it's hidden until you either:)
MyForm.Show
MyForm.ShowDialog

End Sub

What is in your opinion the effect?

Cor
 
Cor,

Cor Ligthert said:
What you think of this

Private sub MyFormClass_load etc

Dim MyForm as New MyFormClass
(it's hidden until you either:)
MyForm.Show
MyForm.ShowDialog

End Sub

What is in your opinion the effect?

Well, you are creating a new instance of a certain form type. If creating
the instance is a costly process, this can be performed when the application
is idle to accelerate showing the form later.
 
Herfried,
Well, you are creating a new instance of a certain form type. If creating
the instance is a costly process, this can be performed when the
application is idle to accelerate showing the form later.
I mean in combination with your reply to me, you probably don't believe it,
however I know what the code I showed does. However it will show (three)
forms when the load event is done.

:-)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top