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

Two panels on one form with a Splitter. Works?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.