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. Image for the cookie policy date

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

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

2 Replies

RP Ramesh Praveen Syncfusion Team 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


SA Sameer 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

Loader.
Up arrow icon