472,114 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,114 software developers and data experts.

Two panels on one form with a Splitter. Works?

BBM
I'm trying to set up a form with two panels divided by a Splitter control.

I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to Left, Panel on right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to Left. Works as advertised.

But... if I change to have two panels on the form one on the left with Dock set to Left, a panel on the right with Dock set to Fill, and a Splitter w/ Dock set to Left then the form looks great when you run it, and you can access the Splitter (the cursor changes to the "move Splitter" cursor) but I CANNOT drag the Splitter (the panel on the left does not re-size). Is there a setting I'm overlooking, or does the Splitter just not work between two panels?

Thanks. Sorry if this isn't the right group to post to for WinForms questions.
Nov 16 '05 #1
4 7931
You may have to play around a little bit with SendToBack button,
BringToFront button in the designer toolbar. Select a panel and change those
options.

Splitter will work even in design mode. You will able to resize panels using
splitter during design mode.

--
Shak
(Houston)
"BBM" <bb*@bbmcompany.com> wrote in message
news:2E**********************************@microsof t.com...
I'm trying to set up a form with two panels divided by a Splitter control.

I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to Left, Panel on
right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to
Left. Works as advertised.
But... if I change to have two panels on the form one on the left with Dock set to Left, a panel on the right with Dock set to Fill, and a Splitter
w/ Dock set to Left then the form looks great when you run it, and you can
access the Splitter (the cursor changes to the "move Splitter" cursor) but I
CANNOT drag the Splitter (the panel on the left does not re-size). Is
there a setting I'm overlooking, or does the Splitter just not work between
two panels?
Thanks. Sorry if this isn't the right group to post to for WinForms questions.

Nov 16 '05 #2
Make sure that in InitializeComponent the controls are being added in this
order

1. panel with fill dock
2. splitter with left dock
3. panel with left dock

--
-Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
"BBM" <bb*@bbmcompany.com> wrote in message
news:2E**********************************@microsof t.com...
I'm trying to set up a form with two panels divided by a Splitter control.

I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to Left, Panel on
right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to
Left. Works as advertised.
But... if I change to have two panels on the form one on the left with Dock set to Left, a panel on the right with Dock set to Fill, and a Splitter
w/ Dock set to Left then the form looks great when you run it, and you can
access the Splitter (the cursor changes to the "move Splitter" cursor) but I
CANNOT drag the Splitter (the panel on the left does not re-size). Is
there a setting I'm overlooking, or does the Splitter just not work between
two panels?
Thanks. Sorry if this isn't the right group to post to for WinForms questions.

Nov 16 '05 #3
BBM
Thanks for your response.

As far as I can tell, the SendToBack and BringToFront buttons only affect the way controls look in the Designer. My problem (I think) was in that I was not putting the controls on the design surface in the correct order. I got it to work by putting the controls on the surface in this order...

1) Added Panel1 with Dock set to Left (width about 1/3 of the form),
2) Dropped Splitter to right of Panel1 and set Dock to Left,
3) Dropped Panel2 in area to right of Panel1 and set Dock to Fill.

When I run this form, the Splitter now controls the size of the two panels.

You are right in that unless Panel2 is set to BringToFront you cannot see the Splitter. I couldn't get the Splitter to work in Design Mode though. I'm using the standard WinForms controls.

Thanks for your help.

"Shakir Hussain" wrote:
You may have to play around a little bit with SendToBack button,
BringToFront button in the designer toolbar. Select a panel and change those
options.

Splitter will work even in design mode. You will able to resize panels using
splitter during design mode.

--
Shak
(Houston)
"BBM" <bb*@bbmcompany.com> wrote in message
news:2E**********************************@microsof t.com...
I'm trying to set up a form with two panels divided by a Splitter control.

I can make the Splitter work in the situations described in the

documentation (Listbox or TreeView on left w/Dock set to Left, Panel on
right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to
Left. Works as advertised.

But... if I change to have two panels on the form one on the left with

Dock set to Left, a panel on the right with Dock set to Fill, and a Splitter
w/ Dock set to Left then the form looks great when you run it, and you can
access the Splitter (the cursor changes to the "move Splitter" cursor) but I
CANNOT drag the Splitter (the panel on the left does not re-size). Is
there a setting I'm overlooking, or does the Splitter just not work between
two panels?

Thanks. Sorry if this isn't the right group to post to for WinForms

questions.


Nov 16 '05 #4
BBM
Shakir:

I owe you an apology. You are correct, you can affect the behavior of the
panels separated by a Splitter using SendToBack / BringToFront. The splitter
needs to know the "docking priority" to decide which control "owns" the
common edge to which the controls are docked. For some reason the "docking
priority" is the REVERSE of the z-order (depth) of the control on the design
surface. You control the z-order by using the SendToBack / BringToFront
buttons. Using BringToFront sets z-order to zero, which makes it the LOWEST
docking priority. Other controls with a higher z-order will squeeze the one
with the lowest z-order when the Splitter is moved.

Thanks for your help.

BBM

"Shakir Hussain" wrote:
You may have to play around a little bit with SendToBack button,
BringToFront button in the designer toolbar. Select a panel and change those
options.

Splitter will work even in design mode. You will able to resize panels using
splitter during design mode.

--
Shak
(Houston)
"BBM" <bb*@bbmcompany.com> wrote in message
news:2E**********************************@microsof t.com...
I'm trying to set up a form with two panels divided by a Splitter control.

I can make the Splitter work in the situations described in the

documentation (Listbox or TreeView on left w/Dock set to Left, Panel on
right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to
Left. Works as advertised.

But... if I change to have two panels on the form one on the left with

Dock set to Left, a panel on the right with Dock set to Fill, and a Splitter
w/ Dock set to Left then the form looks great when you run it, and you can
access the Splitter (the cursor changes to the "move Splitter" cursor) but I
CANNOT drag the Splitter (the panel on the left does not re-size). Is
there a setting I'm overlooking, or does the Splitter just not work between
two panels?

Thanks. Sorry if this isn't the right group to post to for WinForms

questions.


Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bevo | last post: by
1 post views Thread by AndrewDucker | last post: by
2 posts views Thread by Zach | last post: by
reply views Thread by ohadasor | last post: by
6 posts views Thread by =?Utf-8?B?bGpsZXZlbmQy?= | last post: by
2 posts views Thread by Rastko Soskic | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.