Adding Custom Component to Toolbox

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
 
D

David So [MSFT]

Fred,

Try put your post in

microsoft.public.dotnet.framework.windowsforms.controls

Basically this is more like desktop specific functionality.

Thanks,

David
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: (e-mail address removed) (Fred Chen)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: Adding Custom Component to Toolbox
| Date: 10 Jul 2003 13:35:18 -0700
| Organization: http://groups.google.com/
| Lines: 33
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 199.93.176.11
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1057869319 22098 127.0.0.1 (10 Jul 2003
20:35:19 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: 10 Jul 2003 20:35:19 GMT
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-
xit-05!sn-xit-09!supernews.com!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:27901
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| 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
|
 

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

Top