Mouse hover over Autohide causes null ref exception

Docking/MDI for Windows Forms Forum

Posted 18 years ago by Geoffrey Allen - software engineer, Kelman Ltd.
Version: 2.0.73
Avatar
Hi,

After loading a layout from an xml file, a mouse hover over an autohide tab group causes a null reference exception in the forms dispose method. It only seems to be in the tabs associated with a dockContainerContainer and not with tabs only associated with a toolWindowContainer. Am I doing something wrong?

Geoffrey

Comments (4)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Geoffrey,

I can't seem to duplicate it in our sample project. Can you either give steps that show it there or email over a sample project of your own that shows it?


Actipro Software Support

Posted 18 years ago by Geoffrey Allen - software engineer, Kelman Ltd.
Avatar
Hi,

I just sent the project to the support email.

If you load the xml layout ChartLayout.xml and then hover over the left autohide tabs this should reproduce the problem,

Geoffrey

[Modified at 10/23/2006 01:06 PM]
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks for the demo... it had to do with the tool window having focus before the layout load and then being auto-hidden by the layout. When the auto-hide tab was hovered over, it would raise the exception because the tool window still retained focus and caused some problems internally.

This is now fixed for the next maintenance release. To work around for now, add this line before calling your layout load code:
dockManager.HostContainerControl.Focus();
[Modified at 10/23/2006 01:09 PM]


Actipro Software Support

Posted 18 years ago by Geoffrey Allen - software engineer, Kelman Ltd.
Avatar
Hi, thanks for the suggested fix and the fast turnaround time!

The suggested fix still manifested the problem (my host container control is the form itself) but I used your suggestion to switch focus to the menu strip which is outside the docking area and that worked.

Geoffrey

Here is my load layout code:-

private void loadLayoutToolStripMenuItem_Click(object sender, EventArgs e)
{
//dockManager.HostContainerControl.Focus();
this.menuStrip1.Focus();
// Show the dialog
openFileDialog.Filter = "XML Tool Window Layout Files (*.xml)|*.xml";
openFileDialog.FileName = "TWLayout.xml";
if (openFileDialog.ShowDialog(this) != DialogResult.OK)
return;

// Load the layout
dockManager.LoadToolWindowLayoutFromFile(openFileDialog.FileName);
}
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.