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)