次の方法で共有


ToolWindows.ToolBox Property

Definition

Gets the ToolBox object.

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

Property Value

A ToolBox object.

Attributes

Examples

This example opens the Toolbox, displays the name of the active tab, adds a new tab, and then deletes it.

Imports EnvDTE  
Imports EnvDTE80  
Public Sub ToolboxManip(ByVal dte As DTE2)  
    Dim myToolBox As ToolBox  
    myToolBox = _applicationObject.ToolWindows.ToolBox  
    _applicationObject.ExecuteCommand("View.toolbox", " ")  
    MsgBox("The total number of Toolbox tabs is: " _  
    & myToolBox.ToolBoxTabs.Count)  
    MsgBox("The name of the active Toolbox tab is: " _  
    & myToolBox.ActiveTab.Name)  
    MsgBox("Adding a MyTab to the Toolbox...")  
    myToolBox.ToolBoxTabs.Add("MyTab")  
    MsgBox("Deleting MyTab from the Toolbox")  
    myToolBox.ToolBoxTabs.Item("MyTab").Delete()  
    End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void ToolboxManip (DTE2 dte)  
{  
    ToolBox myToolBox;  
    myToolBox = _applicationObject.ToolWindows.ToolBox;  
    _applicationObject.ExecuteCommand("View.toolbox", " ");  
    MessageBox.Show("The total number of Toolbox tabs is: "   
+ myToolBox.ToolBoxTabs.Count);  
    MessageBox.Show("The name of the active Toolbox tab is: "   
+ myToolBox.ActiveTab.Name);  
    MessageBox.Show("Adding a MyTab to the Toolbox...");  
    myToolBox.ToolBoxTabs.Add("MyTab");  
    MessageBox.Show("Deleting MyTab from the Toolbox");  
    myToolBox.ToolBoxTabs.Item("MyTab").Delete();  
}  

Applies to