RE: Winforms control layout bug

"Neil Cawse" <[email protected]>
Newsgroups gmane.comp.gnu.dotgnu.developer
Message-ID <AD5227CC61948542858F505100BC7FB01A8E02@Server.burlington.geotab.com>
Simon, Rhys wrote the original layout code which, from what I can make
out, does work.

What ive done in the past (as does swf) is to delay the handle creation
of the control for as long as possible because once the control exists,
every property change can cause the control to be re laid out again.
This could cause any complex form to run very slowly - as used to be the
case. We delay the performlayout till the control is actually created.

 

What should definitely not happen it to perform a layout when
resumelayout(false) is called - it is specifically asking not to do a
layout. What it is asking is that the layout is deferred till control
creation.

What you need to see is why performlayout is not being called when the
control (and its parent) is actually created and therein should be the
bug..

 

________________________________

From: Simon Guindon [mailto:[email protected]] 
Sent: Wednesday, November 03, 2004 9:02 PM
To: DotGNU Devs
Subject: [DotGNU]Winforms control layout bug

 

Hey guys, this email is in response to my last one.

 

I spent another 4 or so hours trying to track down this layout bug, and
I assembled a simple to try test case.

 

I'm looking for some feedback or insight on perhaps a solution.  I've
tried to figure it out but a little lost.

 

The anchoring/sizing isn't happening properly.  The control is a
UserControl, not derived directly from Control.

The Control is docked top, left and right.  This is an app from VS.NET.

 

PNET: http://home.sse.net/layoutbug1.jpg

.NET: http://home.sse.net/layoutbug2.jpg

 

The UserControl is anchoring properly, but child controls inside it, are
not.

 

VS.NET designer is setting the form to suspend layout, then calling
ResumeLayout(false) after the controls are added to the form.  But that
means the controls are never getting PerformLayout() being called.  I'm
not sure if this is the issue or not.  I was thinking of doing this.

 

If ResumeLayout(false) is called, but PerformLayout() has never been
called, maybe its ok to call it?

 

I hope I'm making sense.  The problem is hard to explain, you really
need to compile and try the test case to understand. I've really tried
to solve this myself, but I'm stuck and I don't want to break or tear
down PNET winforms performance from asking it to layout or draw too
much.

 

Curious if I'm on the right track or totally off.

 

Included are the 2 files that need to be compiled to test it.  If you
notice, the control itself is anchoring fine, but any child controls
inside the UserControl are not.

 

Any help greatly appreciated!

 

Thanks,

Simon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.