MyToolWindow toolwindow = new MyToolWindow();
toolwindow.DockManager = dockManager1;
toolwindow.State = ToolWindowState.TabbedDocument;
toolwindow.Location = new Point(70, 70);
toolwindow.Activate(true);
I generate the ToolWindow programmatically like the code above. MyToolWindow is derived from ToolWindow.
public class MyToolWindow : ToolWindow
{
public MyToolWindow() : base()
{
this.Move += MyToolWindow_Move;
}
private void MyToolWindow_Move(object sender, EventArgs e)
{
//do something here.
}
}
I have the move event in the class. The move event is only fired when it is floating or docking window. But if the window is changed to MDI window, and it is moved around via mouse in MDI area, the move event is never fired.
What should I do to make the move event fired?