다음을 통해 공유


ToolBoxTab2.Name Property

Definition

Gets or sets the name of the ToolBoxTab2 object.

public:
 property System::String ^ default { System::String ^ get(); void set(System::String ^ value); };
public:
 property Platform::String ^ default { Platform::String ^ get(); void set(Platform::String ^ value); };
[System.Runtime.InteropServices.DispId(0)]
public string this { [System.Runtime.InteropServices.DispId(0)] get; [System.Runtime.InteropServices.DispId(0)] set; }
[<System.Runtime.InteropServices.DispId(0)>]
[<get: System.Runtime.InteropServices.DispId(0)>]
[<set: System.Runtime.InteropServices.DispId(0)>]
member this.Name : string with get, set
Default Public Property Name As String

Property Value

A string containing the name of the object.

Implements

Attributes

Examples

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

Imports EnvDTE  
Imports EnvDTE80  
Sub ToolBoxTabExample(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()  
        tbxItem = tbxTab.ToolBoxItems.Item(1)  
        MsgBox("Toolbox item name: " & tbxItem.Name)  
    Catch ex As System.Exception  
        MsgBox("ERROR: " & ex.Message)  
    End Try  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void ToolBoxTabExample(DTE2 dte)  
{  
    ToolBox tlBox;  
    ToolBoxTabs tbxTabs;  
    ToolBoxTab2 tbxTab;  
    ToolBoxItem tbxItem;  
    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 first Toolbox tab is: "   
+ tbxTab.Name);  
        tbxTab.Activate();  
        tbxItem = tbxTab.ToolBoxItems.Item(1);  
        MessageBox.Show("Toolbox item name: " + tbxItem.Name);  
    }  
    catch (Exception ex)  
    {  
        MessageBox.Show("ERROR: " + ex.Message);  
    }  
}  

Applies to