How to hide a form temporarily when you open a 2nd form?

  • Thread starter Thread starter Todd Jaspers
  • Start date Start date
T

Todd Jaspers

Hey guys,

I've got a MAIN form, which I have a series of navigational buttons on.
When I open a secondary form from that form, I'd like to be able to HIDE the
original form. The reason is, if the user wants to minimize the application
so that he / she can then do something else, I don't want them to immediately
see the original form.

On the other hand, when they exit from the 2nd form, I'd like for the
original form (the MAIN screen) to re-appear.

How can I do this?


Any ideas?


Thanks!
 
You could put something like this in the event handler:
//assuming this is the main form
this.Hide();
newform.ShowDialog(this);
this.Show();


That would hide the form while the 2nd is show. However, passing the main
form as the owner of the dialog should keep it shown above it.

If you dont want the 2nd form to be model, you would need to handle the
OnClosed event to show the main form.

HTH
 
OMG, you're so awesome. Thank you!!!

Ciaran O''Donnell said:
You could put something like this in the event handler:
//assuming this is the main form
this.Hide();
newform.ShowDialog(this);
this.Show();


That would hide the form while the 2nd is show. However, passing the main
form as the owner of the dialog should keep it shown above it.

If you dont want the 2nd form to be model, you would need to handle the
OnClosed event to show the main form.

HTH
 
Back
Top