Panels and Splitters

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I'm using .NET Framework 2.0. I'm creating several panels, one above
the other, with splitters between them. I'm using Splitter and not
SplitContainer, because the latter is such a big mess when you need to
put splitters between more than two windows.

To be more specific, my splitters and panels are like that:
_
|_|
|_|
|_|

Where the rectangles are the panels and the underscores are the
splitters. When I drag a splitter up, it can go up as much as I want.
Even make the top panel very small. But when I want to drag them down,
it lets me drag only to a specific point, so I cannot make the lower
panel small.

Anyway, here is my code:

private void InitPanel()
{
panel = new Panel();
panel.Tag = this;
panel.BorderStyle = BorderStyle.Fixed3D;
panel.Dock = DockStyle.Top;
panel.AllowDrop = true;
panel.DragEnter += new DragEventHandler(panel_DragEnter);
panel.DragDrop += new DragEventHandler(panel_DragDrop);
panel.MouseUp += new
MouseEventHandler(chart.Panel_MouseUp);
chart.PanesPanel.Controls.Add(panel);
panel.BringToFront();
}

private void CreateSplitContainer()
{
splitter = new Splitter();
splitters.Add(splitter);
splitter.MinExtra = splitter.MinSize = 0;
splitter.Dock = DockStyle.Top;
splitter.SplitterMoved += new
SplitterEventHandler(chart.SplitContainer_Move);
splitter.MinSize = 15;
chart.PanesPanel.Controls.Add(splitter);
splitter.BringToFront();
}

The problem is that when, using the splitters, I'm trying to make the
panels smaller, they have a limit of how small it can go, and it's
about 100-150 pixels (quite much). I need a possibility to use the
splitters to make the panels much smaller, such as 15 pixels.

How can I do that?

Thanks!

.



Relevant Pages

  • Do you like the SplitterContainer?
    ... I had a form with 6 panels separated by 5 splitters. ... The first container replace the first panel. ... Supposed the original were not panels but, say, pictureboxes. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: TSplitter Persistence problem
    ... > I have a form setup with 3 Panels and 2 Splitters as follows: ... > At FormClose I save Panel1.Height and Panel2.Height and at ... You could try to save the splitters' positions instead of the ... panels' dimensions. ...
    (alt.comp.lang.borland-delphi)
  • Re: How can I splite the form into four parts?
    ... I think what you want to do is add 4 panels to your Form ... (Splitters would be optional) ... About the Dock Property ... > How can I splite the form into four parts? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: making elements of a window form resizable
    ... Basically, you put a group of controls within a panel, and either dock ... Then you put panels within other panels, and dock them so that when the ... Then arrange the highest-level panels and splitters within the Form, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help: Floating Point PRoblem
    ... splitters jumped around by a few pixels, ... Key here is that you need to keep the ratios strictly as percentages. ... and round THAT value to a pixel position. ...
    (microsoft.public.vc.mfc)