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
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