Search the web
Sign In
New User? Sign Up
vsnetaddin · Visual Studio.NET Add-ins
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Add programmatically Tab and item onto Toolbox   Message List  
Reply | Forward Message #3827 of 3878 |
Hi,

I'm able to create a tab, but i'm not able to install the component..
here is my 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.vsWindowKindToolbox);
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("RogTech",
@"XTGrid.dll",
vsToolBoxItemFormat.vsToolBoxItemFormatDotNETComponent);

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

}

1. Where is the problem ?
2. how can i make it working with VS.NET 2008 ?

thanks a lot.




Tue Oct 9, 2007 2:11 pm

x04001
Offline Offline
Send Email Send Email

Forward
Message #3827 of 3878 |
Expand Messages Author Sort by Date

Hi, I'm able to create a tab, but i'm not able to install the component.. here is my code : // Create a EnvDTE object. System.Type t =...
x04001
Offline Send Email
Oct 9, 2007
2:25 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help