473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

add control onto ToolBox palette

Hi,

I'm still struggling with my issue about how programmatically add a
custom control on Toolbox palette.

it creates well my TAB with my custom name, but it does not add my
custom control.
where could the problem be ?

here is the code :

// Create a EnvDTE object.
System.Type t = System.Type.GetTypeFromProgID("VisualStudio.DTE.8. 0");
// visual studio 2005

object obj = System.Activator.CreateInstance(t, true);
EnvDTE.DTE env = (EnvDTE.DTE)obj;

// Find the ToolBox Window and ToolBox Tabs collection
Window win = env.Windows.Item(EnvDTE.Constants.vsWindowKindTool box);
ToolBox tb = (ToolBox)win.Object;
ToolBoxTabs tbts = tb.ToolBoxTabs;

// check if the tabs we will create, already exist
int i = 1;
bool bFound = false;
while ( (i < tbts.Count) && !bFound)
{
if (tbts.Item(i).Name == "RogTech")
{
// the tab already exists, so we will update it with new control version
bFound = true;
}

i++;
}
if (!bFound)
{
// the tab does not exist, so we will create it.
// Insert a new Tab in the tab collection.
ToolBoxTab tbt = tbts.Add("RogTech");
tbt.Activate();

// Insert the new Component.
EnvDTE.ToolBoxItem tbi = tbt.ToolBoxItems.Add("XGrid",
@"XTGrid.dll",
vsToolBoxItemFormat.vsToolBoxItemFormatDotNETCompo nent);

// release environment
env.Solution.Close(false);
Marshal.ReleaseComObject(env);

}

thanks a lot,

RAF
Oct 11 '07 #1
0 1327

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jacky Luk | last post by:
Does anyone know of a downloadable Line ActiveX control which allows me to plot straight lines on a VC++.NET form? Thanks Jack
0
by: Dave | last post by:
I'm creating a custom control. To start, I created the control in a seperate project in the same solution. I didn't change anything from the template vs.net creates for a web custom control, I...
14
by: Graham Blandford | last post by:
Hi there, A quickie I think... If I create a new class that inherits the values of a windows form component class, can there ever be a visual representation of this in the .Net IDE? E.g. if...
2
by: Tony Hedge | last post by:
Hello, Framework: NET 1.1, Language VB So I am going through the basic walkthrough example in .NET on how to create a simple custom control. Takes about 2 minutes and when done I have a DLL...
1
by: Steph | last post by:
Hello has all, I am in .NET 2 and Visual Studio 2005 and I seek deseperement how to create a webusercontrol in the form of DLL (to insert it in the pallet tools of VS). Well on it is not a...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
5
by: John Kotuby | last post by:
Hi all, This is my first time trying to creaet and use a custome Web Control in a Web Site project in ASP.NET 2.0 with VS 2005 and VB. I created the control in a separate Web Control Library...
0
by: R.A.F. | last post by:
Hi, I wrote a little app which should add on Toolbox palette my custom controls. however, it does not work. it creates well my TAB with my custom name, but it does not add my custom control....
7
by: =?Utf-8?B?bWF0dCBw?= | last post by:
Steve Orr has a neat Captcha control: http://steveorr.net/articles/CAPTCHASP.aspx but aside from "dragging the control onto your toolbox.." Does anyone have any installation instructions: e.g....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.