F
Fred Chen
Hi,
I've created a custom component for smart devices and I am trying to
add this component to my toolbox through an installer.
I've read previous posts and msdn documentation on using the DTE
object and the various ToolBox collections within.
I've been able to create a new ToolBoxTab but I am not able to add any
items to this tab.
For now, I am trying to add a Text item to the ToolBox (If this works,
I will move on to trying to add the component).
DTE myDTE = (DTE)Microsoft.VisualBasic.Interaction.CreateObject
_("VisualStudio.DTE.7.1", "");
ToolBox myTBx = (ToolBox)myDTE.Windows.Item
_(Constants.vsWindowKindToolbox).Object;
ToolBoxTabs myTBxTabs = myTBx.ToolBoxTabs;
ToolBoxTab myTBxTab = myTBxTabs.Add("MyTabName");
myDTE.ExecuteCommand("View.PropertiesWindow", "");
myTBxTab.Activate();
EnvDTE.ToolBoxItem myItem = myTBxTab.ToolBoxItems.Add("New Text Item",
"Some text", EnvDTE.vsToolBoxItemFormat.vsToolBoxItemFormatText);
myDTE.Quit();
myDTE = null;
Any ideas?
Thanks,
Fred
I've created a custom component for smart devices and I am trying to
add this component to my toolbox through an installer.
I've read previous posts and msdn documentation on using the DTE
object and the various ToolBox collections within.
I've been able to create a new ToolBoxTab but I am not able to add any
items to this tab.
For now, I am trying to add a Text item to the ToolBox (If this works,
I will move on to trying to add the component).
DTE myDTE = (DTE)Microsoft.VisualBasic.Interaction.CreateObject
_("VisualStudio.DTE.7.1", "");
ToolBox myTBx = (ToolBox)myDTE.Windows.Item
_(Constants.vsWindowKindToolbox).Object;
ToolBoxTabs myTBxTabs = myTBx.ToolBoxTabs;
ToolBoxTab myTBxTab = myTBxTabs.Add("MyTabName");
myDTE.ExecuteCommand("View.PropertiesWindow", "");
myTBxTab.Activate();
EnvDTE.ToolBoxItem myItem = myTBxTab.ToolBoxItems.Add("New Text Item",
"Some text", EnvDTE.vsToolBoxItemFormat.vsToolBoxItemFormatText);
myDTE.Quit();
myDTE = null;
Any ideas?
Thanks,
Fred