Installing new component in Visual Studio .Net ToolBox

J

Javier Ros

Hi guys!, I´m tring to install my own component in the Visual Studio .Net
ToolBox,
I have tried with this code:

// Create a EnvDTE object.
System.Type t = System.Type.GetTypeFromProgID("VisualStudio.DTE.7.1");
object obj = System.Activator.CreateInstance(t, true);
EnvDTE.DTE env = (EnvDTE.DTE)obj;

// Find the ToolBox Window and ToolBox Tabs collection
Window win = env.Windows.Item(EnvDTE.Constants.vsWindowKindToolbox);
ToolBox tb = (ToolBox)win.Object;
ToolBoxTabs tbts = tb.ToolBoxTabs;

// Insert a new Tab in the tab collection.
ToolBoxTab tbt = tbts.Add("New Tab");
tbt.Activate();

// Insert the new Component.
EnvDTE.ToolBoxItem tbi = tbt.ToolBoxItems.Add("My Custom Component",
@"c:\MyCustomControls.dll",
vsToolBoxItemFormat.vsToolBoxItemFormatDotNETComponent);

I can see the new tab "New Tab" but this tab is empty, I can´t insert the
new component.

Any ideas?

Thanks in advance.

Javier Ros Moreno
 
G

Guest

Javier,

I would recommend you try postin on the Yahoo! Group VSNETADDIN. Those
guys are real experts on the VS.NET DOM.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top