I'm trying to create a VS add-in that loads data from a web service.
There is one primary tool window that has a list of projects (in a
treeview). Double-clicking one of these issues brings up another window
with a list of bugs. Double-clicking on one of these bugs brings up yet
another window with the bug information.
I'm at a bit of a loss on how to create the windows. There seems to be
two options: a normal add-in or a VSPackage. I've tried both and have
had some issues with each. I'd like to hear which I should be using and
how I can get it to work.
I tried creating a normal add-in using the shim control
(VSUserControlHostLib). I create each type of window using this and
just loaded a separate control for each. This worked great except for
two things:
- Despite my efforts, the add-in only loaded when you click on its
menu item under Tools.
- All the windows appeared as floating windows in the middle of the
screen - they weren't docked in the proper places.
I hadn't attacked the first issue so much because I didn't see a way to
solve the second issue. I want my primary window to attach itself to
the Solution Explorer and the other windows to appear in the main
editor area. Is there a way to do this without using VSIP? Except for
my primary window, all the others are created dynamically, so adding
their GUIDs to the registry doesn't look like a valid solution.
I also tried using VSIP. I got my primary window working beautifully.
It docked Solution Explorer properly and loaded up correctly when VS
loaded. I have been unable to figure out how to create the other
windows though.
It seems like what I want is two sets of custom editors: one for the
list of bugs and one for the actual bug information. Unfortunately, I
haven't been able to figure out how to actually create custom editors
(there are no samples and the documentation is limited to "this is
possible").
The VSIP wizard created a custom editor for me, but it was a text
editor that was tied to a certain extension, which is not at all what I
need. I ripped out the textview from the control it created and somehow
changed it to not register itself as a new document type, but I don't
know how to create any editors.
I think I need to use EditorFactory.CreateEditorInstance, but there are
lots of poorly named parameters with (again) little documentation. I
could really use a good sample. And if I learn how, I also need to
figure how to create another custom editor for the other window type.
How can I create custom editors and create instances of those editors?
I've found most of the documentation for this to be pretty sparse and
I've tried searching the net for necessary information but haven't been
able to find what I'm looking for. I'd really appreciate some help.
Thanks,
--
Matt Diephouse
Hi Matt,
Some ideas:
- You don´t need VSIP for this. A regular add-in will do.
- You can create toolwindows with or without shim controls in VS.NET 2002,
VS.NET 2003 and VS 2005. See my article:
HOWTO: Create a dockable toolwindow from a Visual Studio .NET add-in
http://www.mztools.com/articles/2006/MZ007.htm
- A toolwindow can be floating, docked or tabbed. The state is controlled
through the Dockable and Floating properties. To make it tabbed, use
Floating=False, Dockable=False.
- The state, size and position of a toolwindow is preserved as long as you
use always the same GUID for that window when calling CreateToolwindow.
You have lots of resources and articles at my web site (below)

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Matt Diephouse" <mddiep@gmail.com> escribió en el mensaje
news:1138983492.138762.15830@o13g2000cwo.googlegroups.com...
> I'm trying to create a VS add-in that loads data from a web service.
> There is one primary tool window that has a list of projects (in a
[quoted text clipped - 56 lines]
> --
> Matt Diephouse
Matt Diephouse - 11 Feb 2006 21:16 GMT
> - A toolwindow can be floating, docked or tabbed. The state is controlled
> through the Dockable and Floating properties. To make it tabbed, use
> Floating=False, Dockable=False.
I see that if I right click on the toolwindow's title bar and select
"Tabbed Document" (and in doing so unselect Floating and Dockable), the
toolwindow appears as a document, like I want it to. But I've been
unable to find the Dockable and Floating properties that you mentioned.
Where are they?
Thanks,
--
Matt Diephouse
Matt Diephouse - 11 Feb 2006 22:18 GMT
Also, is it possible prevent a toolwindow from closing when the user
clicks on the X? I'd like to pop up some sort of window confirming that
the user wants to close the window if there is unsaved information. Or
do I need to implement a custom editor using VSIP if I want to do this?
Matt Diephouse - 11 Feb 2006 22:20 GMT
Also, is it possible prevent a toolwindow from closing when the user
clicks on the X? I'd like to pop up some sort of window confirming that
the user wants to close the window if there is unsaved information. Or
do I need to implement a custom editor using VSIP if I want to do this?
Matt Diephouse - 13 Feb 2006 02:06 GMT
Matt Diephouse wrote:
> > - A toolwindow can be floating, docked or tabbed. The state is controlled
> > through the Dockable and Floating properties. To make it tabbed, use
[quoted text clipped - 5 lines]
> unable to find the Dockable and Floating properties that you mentioned.
> Where are they?
They're spelled IsFloating and Linkable. Setting both those Window
properties to false makes the window appear in the main document area.
--
Matt Diephouse
Carlos J. Quintero [VB MVP] - 13 Feb 2006 10:42 GMT
Hi Matt,
Yes, they are named Linkable and IsFloating. Sorry about the misspelling.

Signature
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Matt Diephouse" <mddiep@gmail.com> escribió en el mensaje
news:1139796388.624712.80360@z14g2000cwz.googlegroups.com...
> Matt Diephouse wrote:
> They're spelled IsFloating and Linkable. Setting both those Window
> properties to false makes the window appear in the main document area.
>
> --
> Matt Diephouse