3

Calling MyPanel.Panel1.Hide(); or MyPanel.Panel2.Hide(); simply hides the controls inside the panel... but I want to have the other side of the panel fill up the whole space.

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

Timothy Khouri
  • 31,315
  • 21
  • 88
  • 128

2 Answers2

5

Use MyPanel.Panel1Collapsed = true; to collapse Panel1 (likewise for panel2).

Ron Warholic
  • 9,994
  • 31
  • 47
2

To hide one of the panels you can call

MyPanel.Panel1Collapsed = true; // or Panel2Collapsed

If Panel2 was collapsed, it will toggle its state to be shown after this call.

MSDN Reference

itsmatt
  • 31,265
  • 10
  • 100
  • 164