[Mono-winforms-list] Need help to understand WinForms code

Ernesto equistango at gmail.com
Wed Oct 3 12:31:12 EDT 2007


Hi,

I'm working on bug #328019

The problem seems to be that MdiParent is changed during MDI children's 
load event (although it'is set to the same parent again, MdiParent.set 
does it's thing anyway). .NET allows a MdiParent change during the load 
event of a children even to a different parent.

The simplified problem is:

MdiParent.set {
    ...
    if(value != null) {
       ...
        if (IsHandleCreated)
            RecreateHandle ();
    }
}

Now RecreateHandle() will cause a chain reaction of handle destruction 
(and recreation). The question is, why must the handle be recreated (via 
DestroyHandle by the way) when changing parents?

Of course, the test app for this bug will pass if you comment 
RecreateHandle ();

Regards,
Ernesto



More information about the Mono-winforms-list mailing list