By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

Adding item to ToolBox using DTE

P: n/a
Hi,

I've created a custom component 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.CreateObjec t
_("VisualStudio.DTE.7.1", "");
ToolBox myTBx = (ToolBox)myDTE.Windows.Item
_(Constants.vsWindowKindToolbox).Object;
ToolBoxTabs myTBxTabs = myTBx.ToolBoxTabs;
ToolBoxTab myTBxTab = myTBxTabs.Add("MyTabName");
myTBxTab.Activate();

EnvDTE.ToolBoxItem myItem = myTBxTab.ToolBoxItems.Add("New Text Item",
"Some text", EnvDTE.vsToolBoxItemFormat.vsToolBoxItemFormatText );

myDTE.Quit();
myDTE = null;

Any ideas?

Thanks,
Fred
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.