P
peter hansen
in VB6 it was possible to load and unload forms - how do I do this in VB.NET
I think I have been almost everywhere
// Peter

// Peter
* "peter hansen said:in VB6 it was possible to load and unload forms - how do I do this in VB.NET
I think I have been almost everywhere
Klaus Löffelmann said:Peter,
Dim frmInstance as New Form1() ' Form is loaded
frmInstance.Dispose() ' Form is unloaded
Herfried K. Wagner said:Loading:
\\\
Dim f As New FooForm()
f.Show()
///
Unloading: Call the form's 'Close' method.
Klaus Löffelmann said:That might be, if form1 is your last form. If it is closed, it's disposed -
I guess.
Try hide instead, that only disabled the form, not unloading it.
I'm going to check tomorrow,
Klaus
* "peter hansen said:the Close-thing unloads the program - not only the current form. I need
something that unloads the current form
Klaus Löffelmann said:...but maybe *from* Form1?
If form1 instantiated form2 in a form1-local-variable, and you close form1,
then form1 is destroyed and with it all member variables which would cause
to close form2, too, since its defining object variable runs out of scope
with the closing of form1.
But it's already quite late here (2am), so I'll take a closer look tomorrow.
Post some code here in the meanwhile, that would help!
Good night
Klaus