Export (0) Print
Expand All

ToolBoxItem Interface

Represents an item in the ToolBox.

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

public interface ToolBoxItem

The ToolBoxItem type exposes the following members.

Public propertyCollectionGets the collection containing the ToolBoxItem object supporting this property.
Public propertyDTEGets the top-level extensibility object.
Public propertyNameGets or sets the name of the ToolBoxItem object.

Public methodDeleteRemoves the ToolBoxItem object from the collection.
Public methodSelectCauses this item to become active in the integrated development environment (IDE).

A ToolBoxItem object can contain controls, text, HTML fragments, or other objects.

Sub ToolBoxItemExample()
    Dim tlBox As ToolBox
    Dim tbxTabs As ToolBoxTabs
    Dim tbxTab As ToolBoxTab
    Dim tbxItem As ToolBoxItem

        ' Create an object reference to the IDE's ToolBox object and
        ' its tabs.
        tlBox = DTE.Windows.Item(Constants.vsWindowKindToolbox).Object
        tbxTabs = tlBox.ToolBoxTabs

        ' Select the first ToolBox tab.
        tbxTab = tbxTabs.Item(1)
        tbxItem = tbxTab.ToolBoxItems.Item(4)
        MsgBox("ToolBox item name: " & tbxItem.Name)

    Catch ex As System.Exception
        MsgBox("ERROR: " & ex.Message)
    End Try
End Sub
© 2014 Microsoft