A solution is to have a main form with menu, toolbar, statusbar etc and a set of MDI child forms. Let say the firts MDI child named LogonForm, the 2nd ConnectForm , SearchForm the 3rd , CalendarForm and so on.
Use Hide() and ShowDialog() for the child forms to show only the forms you want to the user and when one visible is closed you can decide which another will be visible.
For eaxmple :
The user click on Logon menu item then call LogonForm.ShowDialog() and hide other child forms. The user press Logon button on the LogonForm and when the logon is done , call Hide() for this the LogonForm and call ShowDialog() for the ConnectForm.
When the user click on Disconnect menu item, for example , you could have one or more child forms open and should not be visible to the user until the Logon menu item is selected again:
Iterate through all child form and call Hide() :
private void CloseChildren()
{
foreach(Form vForm in this.MdiChildren)
vForm.Hide();
}
When user select Exit just call ( I assume Dispose() overloaded)
Application.ExitThread(); or /and
Application.Exit();
-obislavu-