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.