Possible Duplicate:
how to “dock”/attach winforms forms
I have two forms: MainForm and PanelForm.
I have set it up so that PanelForm is attached to MainForm by overriding the OnMove of the MainForm so that the PanelForm moves along with the MainForm. This is to simulate that PanelForm is a panel for the MainForm.
I can dock and undock and PanelForm from the MainForm, as well as collapse it.
The problem is when I minimize the the MainForm or it loses focus to some other application, and when I return to the MainForm, I have to manually Alt-Tab the PanelForm.
Is there a way to just attach the PanelForm to MainForm, without overriding OnMove or other things to simulate that it is attached?
You can not have two “active” forms/windows at the same time. However you can bring one or more windows to the foreground by activating your main window. To do this use the
Form.Show(ownerForm)override.