We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I have only one open form at a time?

Thread ID:

Created:

Updated:

Platform:

Replies:

3894 Apr 16,2003 02:41 PM UTC Apr 23,2003 01:01 PM UTC Windows Forms 2
loading
Tags: FAQ
Bob Rudd
Asked On April 16, 2003 02:41 PM UTC

Hi, How can I design my application so that only one form is open at a time? At present each form instance is created in the "Next" button of the previous form so the deeper I go into the application more and more forms are left open and if I close an earlier form all child forms are also closed. Thanks

Ramesh Praveen [Syncfusion]
Replied On April 16, 2003 07:29 PM UTC

That's an interesting issue. Here is a suggestion. You could have a hidden "manager" form which is what would get run in the Application.Run() method. You could set this form's size to 0,0 in the constructor. Then open the first child form from within this manager form in the form_load. Then when the user chooses Next in the child form, it should fire an event, which the manager form should listen to. In that handler, the manager form could close the current one and open a new child form. And so on. When the user Closes a child form, instead of selecting next/previous. You should close your manager form in turn closing the app. Let me know if this might work for you. Regards, Praveen Ramesh

Sameer
Replied On April 23, 2003 01:01 PM UTC

Simply HIDE the form when u open a new one, and SHOW the form when the new one closes. Parent.Hide() Child.ShowDialog() or Child.Show() Parent.Show() Hope this works -S > Hi, > How can I design my application so that only one form is open at a time? At present each form instance is created in the "Next" button of the previous form so the deeper I go into the application more and more forms are left open and if I close an earlier form all child forms are also closed. > Thanks

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;