Closing one form when another opens

  • Thread starter Thread starter Brad Allison
  • Start date Start date
B

Brad Allison

Is there an easy way to close one form when another opens?

Thanks for the information.

Brad
 
Certainly.

In the Closing event for the form, you can instantiate another form object
and call it's Show method.

You will run into problems if the form you are closing is the main form of
that application. If this is the case, you will have to catch the closing
event as well and cancel the application exit.
 
If you have many instances where forms need to interact in some type of a
relation I would sugest you use a UI managment controler and make it
responsable to manage when forms open or close.
 
Back
Top