Question : Display a form within a Panel.  How to hide caption bar?

When displaying a form within a panel is it possible to display only the controls and the caption bar?  I have an window application with 2 forms.  Form1 has a panel that display Form2.  When Form2 is displayed within the panel the caption bar is also included.  How can I prevent the capition bar from being displayed?  

private void Form1_Load(object sender, EventArgs e)
        {
            Form2 frm2 = new Form2();
            frm2.TopLevel = false;
            frm2.Visible = true;
            panel1.Controls.Add(frm2);
        }

Answer : Display a form within a Panel.  How to hide caption bar?

Set the FormBorderStyle to 'None':
1:
2:
3:
4:
5:
6:
7:
8:
9:
        private void Form1_Load(object sender, EventArgs e)
        {
            Form2 frm2 = new Form2();
            frm2.TopLevel = false;
            frm2.Dock = DockStyle.Fill;
            frm2.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            panel1.Controls.Add(frm2);
            frm2.Show();
        }
Random Solutions  
 
programming4us programming4us