I got intimate with VS toolbox automation, a few months ago...
http://weblogs.asp.net/SAVanNess/posts/5352.aspx
http://weblogs.asp.net/savanness/posts/5701.aspx
I can confirm this bug -- as of VS 7.1, I'm also unable to programmatically add text
items to the toolbox! Can you say "regression"?
Note, I *am* still able to add .NET UserControls, however. (Well, as long as I
remember to workaround EnvDTE.dll's wrong CLSID. And prompt the user to shutdown all
running instances of VS, beforehand. And provide a more lenient OLE message filter.
And... <groan>)
-S
On Fri, 11 Jul 2003 09:32:35 -0400, Fred Chen <[EMAIL PROTECTED]> wrote:
>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