468,161 Members | 1,946 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,161 developers. It's quick & easy.

Layout manager issue when docking panels?

I was playing around with a new Windows form yesterday. I wanted to drop two
panels on the form. The first would be set Dock=Top. The second would be set
Dock=Fill.

So, I dropped the first panel and set its Dock property to Top. I then dropped
the second panel on the form and set its Dock property to Fill.

Holy disappearing panels, Batman. The second panel filled the entire form
hiding the first panel. So, when I dropped my grid control on the second panel
which was set to Dock=Fill, it filled the entire screen.

I eventually got what I needed by cutting and pasting the controls, which was a
suggestion of a fellow developer at work, but it was a bit annoying.

Is there a bug in the layout manager in the forms designer that is causing this
behavior?

Nov 15 '05 #1
4 6144
This is typically due to the Z-ordering of the controls on the form. The
Z-order effects which controls are "on top" of other controls (the 3D
dimension to 2D graphics). You can right-click on a control (such as the
panel) and use the "Bring to Front" and "Send to Back" to change the
Z-ordering of a control.

Actually, when repeating the operation you describe below, I could not
reproduce the exact results with VS.NET 2003. But hopefully the above
mentioned Z-ordering will help if this occurs in the future.

Cheers,

-Noah Coad
Microsoft MVP & MCP

"Kerry Sanders" <di****@NOSPAMyahoo.com> wrote in message
news:4i********************************@4ax.com...
I was playing around with a new Windows form yesterday. I wanted to drop two panels on the form. The first would be set Dock=Top. The second would be set Dock=Fill.

So, I dropped the first panel and set its Dock property to Top. I then dropped the second panel on the form and set its Dock property to Fill.

Holy disappearing panels, Batman. The second panel filled the entire form
hiding the first panel. So, when I dropped my grid control on the second panel which was set to Dock=Fill, it filled the entire screen.

I eventually got what I needed by cutting and pasting the controls, which was a suggestion of a fellow developer at work, but it was a bit annoying.

Is there a bug in the layout manager in the forms designer that is causing this behavior?

Nov 15 '05 #2
Actually it is a bug in VS.Net 2002 that was fixed in VS.Net 2003

It invloves the order that you are adding the panels to the form
You need to drop the panel that you want to Dock=Fill first
Set Dock=Fill
then you can drop the panel that you want to Dock=Top next
Set Dock =Top

"Noah Coad [MCP & MVP]" <no**@coad.net> wrote in message
news:ef**************@TK2MSFTNGP11.phx.gbl...
This is typically due to the Z-ordering of the controls on the form. The
Z-order effects which controls are "on top" of other controls (the 3D
dimension to 2D graphics). You can right-click on a control (such as the
panel) and use the "Bring to Front" and "Send to Back" to change the
Z-ordering of a control.

Actually, when repeating the operation you describe below, I could not
reproduce the exact results with VS.NET 2003. But hopefully the above
mentioned Z-ordering will help if this occurs in the future.

Cheers,

-Noah Coad
Microsoft MVP & MCP

"Kerry Sanders" <di****@NOSPAMyahoo.com> wrote in message
news:4i********************************@4ax.com...
I was playing around with a new Windows form yesterday. I wanted to drop
two
panels on the form. The first would be set Dock=Top. The second would
be set
Dock=Fill.

So, I dropped the first panel and set its Dock property to Top. I then dropped
the second panel on the form and set its Dock property to Fill.

Holy disappearing panels, Batman. The second panel filled the entire

form hiding the first panel. So, when I dropped my grid control on the

second panel
which was set to Dock=Fill, it filled the entire screen.

I eventually got what I needed by cutting and pasting the controls,
which was a
suggestion of a fellow developer at work, but it was a bit annoying.

Is there a bug in the layout manager in the forms designer that is
causing this
behavior?


Nov 15 '05 #3
Thanks for the replies everyone. I am not sure if the
issue has been fixed, because I definited duplicated it
yesterday in .Net 2003 as have others in our office.

Anyway, thanks for the tip on the order in which the
panels should be dropped. Much appreciated!
-----Original Message-----
Actually it is a bug in VS.Net 2002 that was fixed in VS.Net 2003
It invloves the order that you are adding the panels to the formYou need to drop the panel that you want to Dock=Fill firstSet Dock=Fill
then you can drop the panel that you want to Dock=Top nextSet Dock =Top


Nov 15 '05 #4
>It invloves the order that you are adding the panels to the form
You need to drop the panel that you want to Dock=Fill first
Set Dock=Fill
then you can drop the panel that you want to Dock=Top next
Set Dock =Top

I just how had a chance to try this out. This tip worked perfectly. Thanks
again.

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Steve McLellan | last post: by
25 posts views Thread by Dennis | last post: by
blazedaces
6 posts views Thread by blazedaces | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.