By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,671 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,671 IT Pros & Developers. It's quick & easy.

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

P: n/a
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!
Jul 10 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Todd Jaspers" wrote:
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!
Jul 11 '08 #2

P: n/a
OMG, you're so awesome. Thank you!!!

"Ciaran O''Donnell" wrote:
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
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Todd Jaspers" wrote:
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!
Jul 11 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.