Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to remove panel2 from SplitContainer in Windows Forms?

Tags:

c#

.net

winforms

I have a windows form with a SplitContainer. I need to hide/remove the panel2 from this container and I want the panel1 to occupy the entire form. Is it possible to do this?

like image 512
Jyina Avatar asked Apr 17 '12 14:04

Jyina


2 Answers

Set property Panel2Collapsed to true:

splitContainer.Panel2Collapsed = true;
like image 142
Sergey Berezovskiy Avatar answered Nov 03 '22 00:11

Sergey Berezovskiy


http://msdn.microsoft.com/en-us/library/system.windows.forms.splitcontainer.panel2.aspx

It is not possible to remove it.

You can, however, hide it:

splitContainer1.Panel2.Hide();
like image 42
John Avatar answered Nov 03 '22 01:11

John