|
From: | Neil Cawse |
Subject: | RE: [DotGNU]Winforms control layout bug |
Date: | Tue, 9 Nov 2004 23:55:37 -0500 |
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:address@hidden 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. 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 |
[Prev in Thread] | Current Thread | [Next in Thread] |