UniqueID Property
Collapse the table of content
Expand the table of content

ToolBoxTab2.UniqueID Property

 

Sets or gets a unique ID for the specified tab.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

string UniqueID { get; set; }

Property Value

Type: System.String

A unique ID.

This example selects and activates the first ToolBoxTab2 item and displays its name and unique name in a message box.

using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
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);
    }
}
Return to top
Show:
© 2016 Microsoft