Splitters, docking and forms

  • Thread starter Thread starter Gary Shell
  • Start date Start date
G

Gary Shell

We are playing around with using the splitter on a form and want to do the
following:

1. On the left side of the form will be a tree view.
2. To the right of that tree view would be a splitter.
3. To the right of that splitter would be a second tree we call a palette.
4. To the right of the palette would be another splitter.
5. To the right of that splitter would be our "content area".

We are trying to find a way to allow this palette portion to be floatable
and or dockable ala VISIO, which allows multiple panes to either be docked
or floating. Can anyone point me to some examples of how to implement this
in VB?

Thanks,
Gary
 
Hi Gary,

If you can afford some third party components, then you better try .NET
Magic UI Library.

Thank You,
rawCoder
 
A splitter is always between 2 other controls, so you need
1. tree
2. splitter
3. panel containing:
3.1 palette tree
3.2 splitter
3.3 content

when adding a splitter you must use a cetain order and docking:

"splitter control allows the user to resize the docked control that
is immediately before it.
Therefore, to enable the user to resize a docked control at run
time:
1. Dock the control to be resized to an edge of a container.
2. Dock a splitter control to the same side of that container."

e.g: 1 splitter.
control1.Dock = DockStyle.Left
splitter1.Dock = DockStyle.Left
splitter1.MinExtra = 100 ' Set the minimum size control2
can be sized to.
splitter1.MinSize = 75 ' Set the minimum size control1
can be sized to.
control2.Dock = DockStyle.Fill ' Set control2 to fill the
remaining space on the form.
Me.Controls.AddRange(New Control() {control2, splitter1,
control1}) ' Add in reverse order to ensure proper location.

e.g: 2 Splitters.
control1.Dock = System.Windows.Forms.DockStyle.Left
control1.Width = Me.ClientSize.Width \ 3
control2.Dock = System.Windows.Forms.DockStyle.Top
control2.Height = Me.ClientSize.Height * 2 \ 3
control3.Dock = System.Windows.Forms.DockStyle.Fill

splitter1.Location = New System.Drawing.Point(121, 0)
splitter1.Width = 3
splitter2.Dock = System.Windows.Forms.DockStyle.Top
splitter2.Height = 3

panel1.Controls.AddRange(New System.Windows.Forms.Control()
{control3, splitter2, control2}) ' Add in reverse order to ensure proper
location
panel1.Dock = System.Windows.Forms.DockStyle.Fill

Me.Controls.AddRange(New System.Windows.Forms.Control() {panel1,
splitter1, control1}) ' Add in reverse order to ensure proper location


Good luck
Atara
 
Back
Top