ToolBoxTab2.DTE Property


Gets the top-level extensibility object.

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

DTE DTE { get; }

Property Value

Type: EnvDTE.DTE

A DTE object.



In Visual Studio, the DTE object is the root of the automation model, which other object models often call "Application".

This example displays the caption of the active window, obtained through the ToolBoxTab2.DTE object.

using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void ToolBoxTabDTEExample (DTE2 dte)
    ToolBox tlBox;
    ToolBoxTabs tbxTabs;
    ToolBoxTab2 tbxTab;
        // Create an object reference to the IDE's ToolBox object and
        // its tabs.
        tlBox = (ToolBox)_applicationObject.Windows.Item
        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);
        MessageBox.Show("The caption of the active window, 
obtained through the DTE object, is: " + "\n" 
+ tbxTab.DTE.ActiveWindow.Caption);
    catch (Exception ex)
        MessageBox.Show("ERROR: " + ex.Message);
Return to top