Anchor property can hardly help. Try combination of panels with the class
System.Windows.Forms.Splitter
, see
http://msdn.microsoft.com/en-us/library/system.windows.forms.splitter.aspx[
^], all those control using
Dock
property. This way, you might work it out without mouse event handlers, using just the mouse handler of the
Splitter
.
I generally advise to avoid
Anchor
in favor of
Dock
as
Anchor
required some manual layout (how to make it even on left and right, for example), and it tends to make controls flicker.
A note: if you think you need anything like 50 panels, it's a sign of wrong UI design. Do you need all of the visible at the same time? Poor user… :-)
I usually advise some kind of index/detail design: have a list box or a tree view on the docked on the left, possible a splitter on the right of it, and the single panel on the right. The control on the left works like an index for the content on right. Handling the selection events on the left control, you put different panels onto the right panel. You can have a collection of hidden children panels with only one panel at a time visible or just one panel repopulating its children on each selection event.
—SA