Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Setting Toolbox tab programtically for a component in VS2005
 

Setting Toolbox tab programtically for a component in VS2005

When I add my assembly to the Toolbox via the Tools | Choose Toolbox Items... dialog, the components in my assembly are added to the General tab. How can I tell Visual Studio 2005 programtically to add my components to some other tab ?

I was expecting some attribute placed before the component class which I could set to tell the Toolbox on which tab I my component would be placed, but I could not find such an attribute. But I am sure their must be some way from within my assembly by which I can direct the Toolbox to place a given component on a particular tab, which would be created for it if the tab does not already exist within the Toolbox.
eldiener  Wednesday, August 23, 2006 5:08 PM
DeborahK  Friday, August 25, 2006 11:36 PM
Thanks, i will look closer at DTE. I need to figure out how to handle what event says that the user is adding my assembly to the toolbox, and intercept it in order to add my components to the toolbox tab I want.
eldiener  Saturday, August 26, 2006 3:44 AM
The DTE does not provide any events that can be hooked regarding the Toolbox or the Choose Toolbox Items... dialog. Furthermore even if it had such an event, I would need to create a separate Add-In just to take advantage of it. That seems like overkill to me for what should be a simple operation. However it is impossible within the current DTE event model.

Quite frankly, like the ToolboxItemAttribute or the ToolboxBitmapAttribute, ther should be a simple attribute which one can place before a component definition which tells the toolbox into which tab a component should be added by default. Unfortunately this does not appear to exist. I guess the toolbox designers did not consider it important that the component creator should be able to choose a default toolbox tab for his or her component.
eldiener  Saturday, August 26, 2006 4:27 AM

You can use google to search for other answers

Custom Search

More Threads

• Property-Collection problem
• Serialization of custom colors (and other types)
• TypeConverter problem, please help!!!
• Help about popup control
• Help with creating a custom designer
• Frameset designer control
• Treeview - Problem with multiple languages
• Selecting control within my user control in the Designer
• Form lost objects in design window
• Resources NOT applied on localizable form. I have to manually edit the form at design time for them to be applied.