Docked control load event fires on dispose

Topics related to the Krypton Docking.

Moderators: Phil Wright, Chris Porter

Docked control load event fires on dispose

Postby LisburnLad » Thu Apr 15, 2010 12:32 am

In a docking layout I've found a problem in which the load event of the docked user control gets fired when the application is closing.
This only seems to happen when a tab from a docked group is dragged and dropped to make a new tab group.
This can be demonstrated using the "Standard Docking 2008" example. In the ContentDocument.cs user control I've added a new load event handler:

Code: Select all
private void ContentDocument_Load(object sender, EventArgs e)
  MessageBox.Show( "Load" );

This is hit twice when the project is run since there are 2 instances of this user control in the first docked tab group. If the application is just closed immediately then the load event is not fired again and this function isn't hit. However, if instead when the application is run, "Document 2" is dragged and dropped to form a new tab group, then the load event will be fired again and this function hit when the application is closed.

In my application this is causing me a problem, since some components of my User Control have already been disposed and so the load during close causes a crash.
Posts: 3
Joined: Tue Oct 07, 2008 6:10 pm
Location: Manchester, UK

Return to Krypton Docking

Who is online

Users browsing this forum: No registered users and 2 guests