locked
How to hide/show the tool window but not close it RRS feed

  • Question

  • I have a VS2010 Isolated Shell application and I have a tool window as below

    public class MyWindow : ToolWindowPane

    And this tool window supports multiple instance

        [ProvideToolWindow(typeof (MyWindow ),
            MultiInstances = true,
            Style = VsDockStyle.MDI,
            Transient = true)]
     public sealed class MyVsxPackage : Package

    Then in my application I can open more than one tool window (each tool window has its own window Id), but when I close one of them I just want to hide it, and next time when I reopen the window the settings on the window should keep the same before it was closed, how to handle this?

    In another words, my question is: is there any way that prevent the multiple instance tool window from being closed by click the 'x' button (just hide it)?

    Thanks in advance!


    • Edited by Carlos Liu Wednesday, April 30, 2014 1:15 AM
    Wednesday, April 30, 2014 1:05 AM

All replies

  • Hi,

    >> is there any way that prevent the multiple instance tool window from being closed by click the 'x' button (just hide it)?

    Please read this thread "How to differentiate between tool window close event and tool window auto hide event" first.

    From AllenD's reply, we see Toolwindow actually don't close, ever.  Hitting the 'x' button actually just hides them. The only time a toolwindow actually closes is when the IDE shuts down.

    Best regards,

    Sunny

    Wednesday, April 30, 2014 9:26 AM
  • This is for the single instance tool window, for multiple instances tool window, close means really dispose it
    Wednesday, April 30, 2014 9:29 AM
  • Hi,

    Sorry for my careless.

    I will try to involve some senior engnieer to this case.

    Your patience will be greatly appreciated.

    Best regards,

    Sunny

    Thursday, May 8, 2014 4:02 PM