Using the "WinForms.NET" SplitContainer control, how can I hide the panel dynamically?

Call MyPanel.Panel1.Hide (); or MyPanel.Panel2.Hide (); just hides the controls inside the panel ... but I want the other side of the panel to fill all the space.

So, if I hide Panel1, I want Panel2 to take up all the space, and I want the splitter to disappear. Is it possible, if so, how?

+3
source share
2 answers

Use MyPanel.Panel1Collapsed = true;to collapse Panel1 (same as panel2).

+5
source

To hide one of the panels, you can call

MyPanel.Panel1Collapsed = true; // or Panel2Collapsed

Panel2 , , .

MSDN

+2

Source: https://habr.com/ru/post/1741121/


All Articles