4 pane SplitContainer

  • Thread starter Thread starter shu
  • Start date Start date
S

shu

The SplitContainer divides the space in two, either horizontally or
vertically.
I'd like to divide the space in four. By adding more splitters, the
problem is that they don't keep in synch automatically. It'd be nice if
when the mouse hovers in the center of the four regions a cross
movement icon is displayed, and movement in the two axis is allowed.
With the solution of adding more splitters the user is forced to first
move in one direction and then in the other one.

What do you recommend to achieve this?

Thanks.
 
The existing controls do not do this as they are separate controls. You can
create a custom control that combines the splitters into a single control and
handles the SplitterMoving event for both containers. If the
MouseCursorX/MouseCursorY happens to be around the intersection of the
containers then you could for a split of the second container. The biggest
issue is that while the first container is being split the second container
has to mimic this by continually resizing. If the split is cancelled then
the second container has to be undone. The performance could be slow. I'd
almost recommend not using the splitters during the split operation. Instead
simply keep drawing a vertical and horizontal line from the current mouse
position to the edge of the client area. This would give the illusion of a
splitter without the overhead of a continual redraw. When the split is
finished then notify each container to adjust it's size. The biggest issue
here is getting the splitters to disappear without their contents. Perhaps
you could temporarily make them transparent or something. Then again maybe
showing the original position is not that bad either. As a final note
perhaps the TableLayoutPanel or one of its ilk may work better in this case.
I don't know if they are resizable by the user or not. Finally I'd like to
say that this feature might not be commonly used and therefore may not be
worth the effort needed to implement it. Most splitters are used in 2 or 3
panel views.

Hope this helps,
Michael Taylor - 9/19/05
 
Back
Top