[Mono-winforms-list] Layout before construction?

Chris Seaton chris at chrisseaton.com
Tue Sep 20 18:02:39 EDT 2005


I have a subclass of Control that has custom OnLayout code in it. 
OnLayout is being called before my class's constructor. I can guess how 
that happens - the Control constructor, called before mine, calls 
PerformLayout() or something.

But is that correct behaviour? Most people would expect if a method is 
being called that their constructor has already been called.

Also, just for having my control on its own in a form, my control's 
OnLayout is being called four times before the user sees it.

I don't know how the MS implementation works. I know that's what you're 
cloning, but both behaviours seem strange.

Thanks

Chris Seaton


More information about the Mono-winforms-list mailing list