Anyone know how to open a form inside of a form, that way it doesn't open a new process/ a new bar at the bottom?
How would I do this?
Short version: make the control panel part of the same top-level window so child forms are hosted inside it. As suggested, use an MDI parent — then dock your control panel to the bottom of that parent so the MDI client area (where child windows are shown and minimized) sits above the panel. That gives the exact visual effect described: child windows minimize inside the parent, positioned above the control panel.
Example (WinForms/C# — MDI parent + docked panel):
/* in MainForm (constructor or Load) */
this.IsMdiContainer = true;
var controlPanel = new Panel { Dock = DockStyle.Bottom, Height = 40 };
this.Controls.Add(controlPanel);
/* create an MDI child */
var child = new ChildForm();
child.MdiParent = this;
child.Show(); Alternative: host a form inside a Panel (no MDI) by setting TopLevel = false. That embeds the form visually and lets you build your own “minimize” targets inside the control panel (use a FlowLayoutPanel to hold icons/buttons and restore the form when clicked):
var hosted = new ChildForm();
hosted.TopLevel = false;
hosted.FormBorderStyle = FormBorderStyle.None; // optional
hosted.Dock = DockStyle.Fill;
panelHost.Controls.Add(hosted);
hosted.Show();
/* example: add a restore button when user minimizes */
hosted.Resize += (s,e) =>
{
if (hosted.WindowState == FormWindowState.Minimized)
{
var btn = new Button { Text = hosted.Text, Tag = hosted };
btn.Click += (sender,ea) => ((Form)btn.Tag).WindowState = FormWindowState.Normal;
flowPanel.Controls.Add(btn);
}
}; Notes and troubleshooting:
IsMdiContainer or adjust the MDI client z-order (look up MdiClient in the form's Controls collection). LayoutMdi(MdiLayout.ArrangeIcons) to tidy up minimized-child icons. Jump to Post— Radical Edward 301You can open the form as a dialog using formObj.ShowDialog(). But that makes the form modal and you cannot navigate away until it is closed. You can also set the ShowInTaskbar property to false for a non-modal form that does not show up in the task bar.
If you …
You can open the form as a dialog using formObj.ShowDialog(). But that makes the form modal and you cannot navigate away until it is closed. You can also set the ShowInTaskbar property to false for a non-modal form that does not show up in the task bar.
If you really want the form to be inside a parent, that is an MDI setup. It is more complicated than just opening a form with formObj.Show(), but there are plenty of pages to help you. is one, and another.
Would you be able to minimize the forms?
With MDI, yes, the child form will be minimized inside the parent. Edward has never tried to minimize a modal dialog or a form with ShowInTaskbar disabled. You will need to test those out for yourself.
I need to make the top of a controlpanel act like the bottom of the form, how would I do that, that way the forms get minimized on top of the control panel
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.