views:

245

answers:

2

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?

+4  A: 

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

Ron Warholic
You are beautiful.
Timothy Khouri
+1  A: 

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
Thank you for the additional information about the other panel showing up when setting the first one.
Timothy Khouri