Home Forums WinForms controls Other WinForms controls ActiveWindowChanged event Reply To: ActiveWindowChanged event

User (Old forums)
Post count: 23064

If I call DockTo outside of the SuspendLayout()/BeginUpdate() I receive the events correctly, but there is another bug that I can’t find a workaround for.

The ActiveWindowChanged event works when switching between the tabs of grouped toolwindows, but if you switch focus to another application, and then switch back to this application, the ActiveWindowChanged Event fires pointing to the wrong ToolWindow.

Does anyone know a workaround? This is a frustrating bug.

Simple example:

public Form1()


ToolWindow tw1 = new ToolWindow(new Panel(), “Tool1”);
tw1.Text = “Tool1”;
ToolWindow tw2 = new ToolWindow(new Panel(), “Tool2”);
tw2.Text = “Tool2”;

dockLayoutManager1.ActiveToolWindowChanged += new EventHandler(dockLayoutManager1_ActiveToolWindowChanged);


tw1.DockTo(DockTargetHost.DockHost, DockPosition.Left);
tw2.DockTo(tw1, DockPosition.Group);

Imported from legacy forums. Posted by nader (had 3011 views)