I have an addin that creates a toolwindow using CreateToolWindow2 when VS 2005 starts up. Every thing works great until I run the Project and the toolwindow disappears. What do I need to do to keep the toolwindow from disappearing
Yes I am switching to debug mode to run the project. I am ok with the window hiding during debug mode. The problem is that my window does not come back when I leave debug mode.
Have you tried setting the Visible property to true when you switch back to design mode
Also, you may want to try resetting your window layout. There are a few problems during development time where the multiple values confuse the window layouts in VS. Resetting your window layout (Window | Reset Window Layout) will fix this.
Setting the visibility of the window on the DTEEvents.ModeChaned event when it switches back to design mode works perfectly. The documentation on that was a little bit lacking, but once you pointed me in the right direction I had no problems.
Also, I prefer that to the resetting of the window layout because it does not require any user intervention.
When you run the project, are you switching into debug mode to run the project When window layouts switch, if your tool window is not visible in that layout then we hide the window. We will then bring it back when you leave debug mode because design mode has that window in the layout. There is an event, DTEEvents.ModeChanged that fires when switching betwen debug and design view. You can show your window at that time.
However, this is not the best thing to do as the user may not want to show the window during debug time. The best thing to do is to put a button on a toolbar that the user can click to show the window.
ToolWindow Disappears
Code Dragon
Yes I am switching to debug mode to run the project. I am ok with the window hiding during debug mode. The problem is that my window does not come back when I leave debug mode.
Sarang Baheti
Have you tried setting the Visible property to true when you switch back to design mode
Also, you may want to try resetting your window layout. There are a few problems during development time where the multiple values confuse the window layouts in VS. Resetting your window layout (Window | Reset Window Layout) will fix this.
Craig
Nicole Johanson
Setting the visibility of the window on the DTEEvents.ModeChaned event when it switches back to design mode works perfectly.
The documentation on that was a little bit lacking, but once you pointed me in the right direction I had no problems.
Also, I prefer that to the resetting of the window layout because it does not require any user intervention.
Thanks for your help.
Erick
Ovais Mehboob
When you run the project, are you switching into debug mode to run the project When window layouts switch, if your tool window is not visible in that layout then we hide the window. We will then bring it back when you leave debug mode because design mode has that window in the layout. There is an event, DTEEvents.ModeChanged that fires when switching betwen debug and design view. You can show your window at that time.
However, this is not the best thing to do as the user may not want to show the window during debug time. The best thing to do is to put a button on a toolbar that the user can click to show the window.
Craig