ToolBoxTab2.DTE 属性

定义

获取顶级扩展性对象。

public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
public:
 property EnvDTE::DTE ^ DTE { EnvDTE::DTE ^ get(); };
[System.Runtime.InteropServices.DispId(2)]
public EnvDTE.DTE DTE { [System.Runtime.InteropServices.DispId(2)] get; }
[<System.Runtime.InteropServices.DispId(2)>]
[<get: System.Runtime.InteropServices.DispId(2)>]
member this.DTE : EnvDTE.DTE
Public ReadOnly Property DTE As DTE

属性值

DTE

DTE 对象。

实现

DTE
属性

示例

此示例显示通过对象获取的活动窗口的标题 ToolBoxTab2.DTE

Imports EnvDTE  
Imports EnvDTE80  
Sub ToolBoxTabDTEExample(ByVal dte As DTE2)  
    Dim tlBox As ToolBox  
    Dim tbxTabs As ToolBoxTabs  
    Dim tbxTab As ToolBoxTab2  
    ' Dim tbxItem As ToolBoxItem  
    Try  
        ' Create an object reference to the IDE's ToolBox object and  
        ' its tabs.  
        tlBox = CType(_applicationObject.Windows.Item _  
(Constants.vsWindowKindToolbox).Object, ToolBox)  
        tbxTabs = tlBox.ToolBoxTabs  
        ' Select the first Toolbox tab.  
        tbxTab = CType(tbxTabs.Item(1), ToolBoxTab2)  
        MsgBox(tbxTab.Name)  
        tbxTab.Activate()  
        MsgBox("The caption of the active window, obtained through  _  
        the DTE object, is: " & vbCr & tbxTab.DTE.ActiveWindow.Caption)  
    Catch ex As System.Exception  
        MsgBox("ERROR: " & ex.Message)  
    End Try  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void ToolBoxTabDTEExample (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 caption of the active window,   
obtained through the DTE object, is: " + "\n"   
+ tbxTab.DTE.ActiveWindow.Caption);  
    }  
    catch (Exception ex)  
    {  
        MessageBox.Show("ERROR: " + ex.Message);  
    }  
}  

注解

在中 Visual Studio , DTE 对象是自动化模型的根,其他对象模型通常会调用 "应用程序"。

适用于