Home Forums WinForms controls Other WinForms controls ActiveWindowChanged event

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18063 |

    If I have my ToolWindows docked on top of each other, so that they are tabbed, when I click on the various tabs to get to the ToolWindows, the ActiveWindowChanged event is not being fired.

    Has anyone else seen this. I need to adjust my toolbars based on what window is visible.

    Thanks.

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

    User (Old forums)
    Member
    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()
    {
    InitializeComponent();

    dockLayoutManager1.SuspendLayout();

    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);

    dockLayoutManager1.ToolWindows.Add(tw1);
    dockLayoutManager1.ToolWindows.Add(tw2);
    dockLayoutManager1.ResumeLayout();

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

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.