ToolWindows.ToolBox 屬性
取得 ToolBox 物件。
命名空間: EnvDTE80
組件: EnvDTE80 (在 EnvDTE80.dll 中)
語法
'宣告
ReadOnly Property ToolBox As ToolBox
Get
ToolBox ToolBox { get; }
property ToolBox^ ToolBox {
ToolBox^ get ();
}
abstract ToolBox : ToolBox
function get ToolBox () : ToolBox
屬性值
型別:EnvDTE.ToolBox
ToolBox 物件。
範例
這個範例會開啟 [工具箱] 並顯示使用中的索引標籤名稱,接著會加入一個新的索引標籤再加以刪除。
如需如何像執行增益集一般,執行這個範例的詳細資訊,請參閱 HOW TO:編譯和執行 Automation 物件模型程式碼範例。
Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
ByRef custom As Array) Implements IDTExtensibility2.OnConnection
_applicationObject = CType(application, DTE2)
_addInInstance = CType(addInInst, AddIn)
ToolboxManip(_applicationObject)
End Sub
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 OnConnection(object application,
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
ToolboxManip (_applicationObject);
}
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();
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。