ToolBoxItems 인터페이스

도구 상자 탭의 모든 항목을 포함합니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
<GuidAttribute("395C7DFB-F158-431C-8F43-DDA83B4EF54E")> _
Public Interface ToolBoxItems _
    Inherits IEnumerable
[GuidAttribute("395C7DFB-F158-431C-8F43-DDA83B4EF54E")]
public interface ToolBoxItems : IEnumerable
[GuidAttribute(L"395C7DFB-F158-431C-8F43-DDA83B4EF54E")]
public interface class ToolBoxItems : IEnumerable
[<GuidAttribute("395C7DFB-F158-431C-8F43-DDA83B4EF54E")>]
type ToolBoxItems =  
    interface 
        interface IEnumerable 
    end
public interface ToolBoxItems extends IEnumerable

ToolBoxItems 형식에서는 다음과 같은 멤버를 노출합니다.

속성

  이름 설명
Public 속성 Count ToolBoxItems 컬렉션의 개체 수를 나타내는 값을 가져옵니다.
Public 속성 DTE 최상위 확장성 개체를 가져옵니다.
Public 속성 Parent ToolBoxItems 개체의 직계 부모를 가져옵니다.
Public 속성 SelectedItem 도구 상자 의 탭에 현재 선택된 항목이 있으면 가져옵니다.

위쪽

메서드

  이름 설명
Public 메서드 Add 새 항목을 만들어 도구 상자에 추가합니다.
Public 메서드 GetEnumerator 컬렉션의 항목에 대한 열거자를 가져옵니다.
Public 메서드 Item ToolBoxItems 컬렉션의 ToolBoxItem 개체를 반환합니다.

위쪽

설명

ToolBoxItems 컬렉션의 기본 속성은 이름 또는 서수로 인덱싱할 수 있는 Item 속성입니다.

예제

Sub ToolBoxItemsExample()
    Dim tlBox As ToolBox
    Dim tbxTabs As ToolBoxTabs
    Dim tbxTab As ToolBoxTab
    Dim tbxItems As ToolBoxItems

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

        ' Add a new tab to the ToolBox and select it.
        tbxTab = tbxTabs.Add("New ToolBox Tab")
        tbxTab.Activate()

        ' Add new items to the new ToolBox tab. This shows two
        ' different ways to index the ToolBox tabs. The third item
        ' added is a .NET component that contains a number of 
        ' Web-related controls.
        tbxTab.ToolBoxItems.Add("Text Item", "Hello world")
        tbxTab.ToolBoxItems.Add("HTML Item", "Hello world", _
        vsToolBoxItemFormat.vsToolBoxItemFormatHTML)
        tbxTabs.Item("New ToolBox Tab").ToolBoxItems.Add("DotNET _
        Component", "C:\WINNT\Microsoft.NET\Framework\v1.1.4322 _
        \System.Web.dll", vsToolBoxItemFormat. _
        vsToolBoxItemFormatDotNETComponent)

        ' Use the ToolboxItems collection to access all the items under 
        ' a ToolBox tab.
        tbxItems = tbxTab.ToolBoxItems

        ' List number of ToolboxItems in a ToolBoxTab.
        MsgBox("Number of items in " & tbxTabs.Item(1).Name & " tab: _
        " & tbxItems.Count)

        ' Select the second item in the ToolboxItems collection and 
        ' delete it.
        tbxItems.Item(2).Select()
        If (MsgBox("Delete second ToolBox item?", vbYesNo) = vbYes) _
        Then
            tbxItems.SelectedItem.Delete()
            MsgBox("Number of items in " & tbxTabs.Item(1).Name & " _
            tab: " & tbxItems.Count)
        End If
    Catch ex As System.Exception
        MsgBox("ERROR: " & ex.Message)
    End Try
End Sub

참고 항목

참조

EnvDTE 네임스페이스

기타 리소스

방법: 도구 상자 제어