beginner question - unloading forms

  • Thread starter Thread starter Elmo Watson
  • Start date Start date
E

Elmo Watson

Using vs.Net 2005 - dotNet 2.0
in VB6, I'd do this:
Unload me
Set frmWhtatever = nothing

What is correct for DotNet 2.0?
 
Use Close() method on a form. If you're displaying a modal form, make sure
the calling form also calls Dispose() on it (look into "Using" statement).

Hope this helps.
Andrej
 
Elmo Watson said:
Using vs.Net 2005 - dotNet 2.0
in VB6, I'd do this:
Unload me
Set frmWhtatever = nothing

What is correct for DotNet 2.0?


\\\
frmWhatever.Close()
///

If the form has been shown by calling it's 'ShowDialog' method, you need to
dispose the form after closing it. To do so, either use a 'Using' block or
call its 'Dispose' method.
 
that's another question I had a while back - -
I added in:
frmWhatever vbModal - - and got an error - - -

How do you do that?

(thank you for putting up with my beginner-ness)
 
Elmo Watson said:
that's another question I had a while back - -
I added in:
frmWhatever vbModal - - and got an error - - -

How do you do that?

\\\
Using f As New FooForm()
f.ShowDialog()
End Using
///
 
Thanks all - now I see.....
One last thing - -
there used to be an unload event - - I see a 'Leave' and 'Deactivate - -

If I want to rid a MDI app of all the child forms (I can do that), just
before the MDI form unloads - - what event do I need to put this code into?
 
Elmo Watson said:
Thanks all - now I see.....
One last thing - -
there used to be an unload event - - I see a 'Leave' and 'Deactivate - -

If I want to rid a MDI app of all the child forms (I can do that), just
before the MDI form unloads - - what event do I need to put this code
into?
 
FormClosing event is triggered before a form is closed and FormClosed occurs
after the form has been closed.

Andrej

Elmo Watson said:
Thanks all - now I see.....
One last thing - -
there used to be an unload event - - I see a 'Leave' and 'Deactivate - -

If I want to rid a MDI app of all the child forms (I can do that), just
before the MDI form unloads - - what event do I need to put this code
into?
 
Back
Top