ToolBoxTab2.UniqueID Property
Visual Studio 2012
Sets or gets a unique ID for the specified tab.
Namespace: EnvDTE80
Assembly: EnvDTE80 (in EnvDTE80.dll)
This example selects and activates the first ToolBoxTab2 item and displays its name and unique name in a message box. For more information about how to run this example as an add-in, see How to: Compile and Run the Automation Object Model Code Examples.
using EnvDTE; using EnvDTE80; using System.Windows.Forms; public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { _applicationObject = (DTE2)application; _addInInstance = (AddIn)addInInst; ToolBoxTabUniqueIDExample(_applicationObject); } public void ToolBoxTabUniqueIDExample(DTE2 dte) { ToolBox tlBox; ToolBoxTabs tbxTabs; ToolBoxTab2 tbxTab; try { // Create an object reference to the IDE's ToolBox object and // its tabs. tlBox = (ToolBox)_applicationObject.Windows.Item (Constants.vsWindowKindToolbox).Object; tbxTabs = tlBox.ToolBoxTabs; // Select the first Toolbox tab. tbxTab = (ToolBoxTab2)tbxTabs.Item(1); MessageBox.Show("The name of the selected Toolbox tab is: " + tbxTab.Name); tbxTab.Activate(); MessageBox.Show("The unique ID of the Toolbox tab: " + tbxTab.Name + " is " + tbxTab.UniqueID); } catch (Exception ex) { MessageBox.Show("ERROR: " + ex.Message); } }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.