splitcontainer auto resizeing

W

Walter Sobchak

I have a split container and on panel 1 I have a groupbox.
When I change group box visibility I want the splitcontainer to auto
resize so that the panel2 is ether covering the whole space (groupbox
invisible) or to resize to fill the space when the groupbox is visible.
I tried to do it with panel1.AutoSizeMode = GrowAndShrink and
panel1.AutoSize = true in the designer.

Any other ideas how this could be done?
Thanks in advance.
 
W

Walter Sobchak

Collapse panel property does the trick.
But my groupbox location gets changed. The ancor is set to all sides.
Docking in set to none because otherwise the borders aren't visible.
 
W

Walter Sobchak

Mark said:
You can set the Padding property on the panel to make those borders
visible.

I tried but it didn't help.
The situation is like this:

splitcontainer1.Panel2
panel1
panel2
panel3
groupbox

The panels are always within the groupbox borders which are all under
splitcontainer panel. The anchor of them are set to all sides.
When I resize the form it all works ok.
The problem is when I collapse the splitcontainer1.Panel2. After
collapsing back the groupbox borders are not visible (I guess the panels
are spread) and the position is a little bit changed.
I tried setting the padding of panels to values of 2, 5, and 10 but it
didn't help.
What am I doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top