By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,236 Members | 1,795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,236 IT Pros & Developers. It's quick & easy.

splitter problems

P: n/a
Hi,
I have a group of controls in a panel on the right-hand side of a
splitter and a treeview on the left-hand side.
The only configuration that I can find to make the right-hand side
resize correctly is:

lhsTreeview - Dock = Fill, Anchor = Top,Left
splitter - Dock = Right
rhsPanel - Dock = Right, Anchor = Top,Left

The problem is that resizing the form repositions the splitter, making
the the left-hand side treeview grow, I would rather that the splitter
not reposition, resulting in the right-hand side growing.

What settings should be changed to make this happen.

Thanks

Nov 15 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
hi john
the splitter and it's functions really depends on the order where
the control are placed on the form.
i would do the following
1. place the treeview - Dock = left
2. place the splitter - Dock = left
3. place rhsPanel - Dock = fill

"John" <john@no_spam> wrote in message
news:ua**************@tk2msftngp13.phx.gbl...
Hi,
I have a group of controls in a panel on the right-hand side of a
splitter and a treeview on the left-hand side.
The only configuration that I can find to make the right-hand side
resize correctly is:

lhsTreeview - Dock = Fill, Anchor = Top,Left
splitter - Dock = Right
rhsPanel - Dock = Right, Anchor = Top,Left

The problem is that resizing the form repositions the splitter, making
the the left-hand side treeview grow, I would rather that the splitter
not reposition, resulting in the right-hand side growing.

What settings should be changed to make this happen.

Thanks

Nov 15 '05 #2

P: n/a
John <john@no_spam> wrote in news:ua**************@tk2msftngp13.phx.gbl:
Hi,
I have a group of controls in a panel on the right-hand side of a
splitter and a treeview on the left-hand side.
The only configuration that I can find to make the right-hand side
resize correctly is:

lhsTreeview - Dock = Fill, Anchor = Top,Left
splitter - Dock = Right
rhsPanel - Dock = Right, Anchor = Top,Left

The problem is that resizing the form repositions the splitter, making
the the left-hand side treeview grow, I would rather that the splitter
not reposition, resulting in the right-hand side growing.

What settings should be changed to make this happen.


the control that is set to 'fill' will resize when you have a
splitter in place and you resize the window. If you want to have another
control to resize, you have to set that other control to Fill instead of
the treeview, in your case the rhsPanel.

As Stefan said, it depends on the order in the form where the
splitter docks against. You can change that by bringing a control to the
front / sending it to the back in the gui designer.

FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
Nov 15 '05 #3

P: n/a
Stefan wrote:
hi john
the splitter and it's functions really depends on the order where
the control are placed on the form.
i would do the following
1. place the treeview - Dock = left
2. place the splitter - Dock = left
3. place rhsPanel - Dock = fill


Thanks, but that configuration will not reposition the controls on the
rhs, ie. moving the splitter right will move the treeview over the rhs
controls.

Nov 15 '05 #4

P: n/a
Hi,

John wrote:
Thanks, but that configuration will not reposition the controls on the
rhs, ie. moving the splitter right will move the treeview over the rhs
controls.


Have you set the Anchor styles for the controls on the right panel? The
panel itself is DockStyle.Fill so it will resize okay.

-- Pete
Nov 15 '05 #5

P: n/a
Frans Bouma wrote:
As Stefan said, it depends on the order in the form where the
splitter docks against. You can change that by bringing a control to the
front / sending it to the back in the gui designer.


This is correct, the problem is that the order is determined by the
order that you place the controls on the form in the Design view. The
left-hand side control *must* be placed on the form before right-hand
side control. If you placed the right-hand control on first, you must
remove all your controls and start from scratch. I could not find anyway
to get it to work, after placing the right-hand side control first,
either by send to back / front or manually moving the control creation
code in InitializeComponent().

MS Moderators, please take note of this and create a KB article, and,
please, fix it for the next release.

Thanks

Nov 15 '05 #6

P: n/a
John wrote:

MS Moderators, please take note of this and create a KB article, and,
please, fix it for the next release.


The following code in the splitter1.LocationChanged event will show that
the right-hand side panel does not change size if it is placed on the
control after the left-hand side panel in Desgin view with following
configuration:

panel2 Dock=left
panel1 Dock=fill
splitter1 Dock=left

private void splitter1_LocationChanged(object sender, EventArgs e)
{
Trace.WriteLine("Panel1 size: " + panel1.Size.ToString());
Trace.WriteLine("Panel2 size: " + panel2.Size.ToString());
}

Nov 15 '05 #7

P: n/a
John wrote:

The following code in the splitter1.LocationChanged event will show that
the right-hand side panel does not change size if it is placed on the
control after the left-hand side panel in Desgin view


Doh!
"after" should be "before"

Anyways, from the previous posts you get my drift :)

Nov 15 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.