Home Forums WinForms controls Other WinForms controls Detecting which docked windows are visible or change of stat

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

    How do you detect when a docked windows state is changed? Like they click on the X in the corner to hide the docked window? I need an event or something so i can build my menu list of windows to show etc.

    Thanks

    Wesley

    Imported from legacy forums. Posted by wcombs (had 3341 views)

    User (Old forums)
    Member
    Post count: 23064

    There is a StateChanged event on ToolWindow that is raised whenever the ToolWindow’s state changes (e.g. from Docked to Floating to AutoHide).

    As for knowing when the user clicked on the X, this will toggle the ToolWindow’s Visible property and you’ll get a VisibleChanged event in that case.

    Hope this helps!

    Pascal

    Imported from legacy forums. Posted by Pascal (had 203 views)

    User (Old forums)
    Member
    Post count: 23064

    I’m trying to detect when the close button is pressed, as well, and I tried implementing a VisibleChanged eventhandler as you suggested, like so:

    private void OnToolWindowClosed(object sender, EventArgs e)
    {
    ToolWindow window = sender as ToolWindow;
    if(window.Visible == false)
    {
    //Do some stuff
    }
    }

    This works fine for detecting when the ‘X’ is pressed. However, the eventhandler is also fired (with the visible property set to false) when the user re-docks a toolwindow from one location to another. Is there any way to detect only when the ‘X’ button is pressed?

    Imported from legacy forums. Posted by vermeeca (had 195 views)

    User (Old forums)
    Member
    Post count: 23064

    Unfortunately not in the current release. I’ve added this request to our database and we’ll consider it for a future release!

    Thanks!

    Imported from legacy forums. Posted by Pascal (had 4257 views)

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