ToolBoxItem2.Select 메서드

IDE(통합 개발 환경)에서 이 항목이 활성화되도록 설정합니다.

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

구문

‘선언
Sub Select
void Select()
void Select()
abstract Select : unit -> unit
function Select()

설명

이 메서드는 도구 상자에서 이 항목이 선택되도록 합니다.

예제

Sub SelectExample(ByVal dte As DTE2)

    ' Add a new tab to the Toolbox.
    Dim box As ToolBox = dte.ToolWindows.ToolBox
    Dim tab As ToolBoxTab = box.ToolBoxTabs.Add("Sample ToolBoxTab")

    ' Add two ToolBoxItem objects to the new Toolbox tab.
    Dim item As ToolBoxItem = tab.ToolBoxItems.Add("Text Item", _
        "Hello, text item!")
    tab.ToolBoxItems.Add("HTML Item", "Hello, HTML item!", _
        vsToolBoxItemFormat.vsToolBoxItemFormatHTML)

    ' Select the "Text Item" ToolBox item.
    box.Parent.AutoHides = False
    box.Parent.Activate()
    tab.Activate()
    item.Select()

    If MsgBox("Delete the selected ToolBox item?", MsgBoxStyle.YesNo) _
        = MsgBoxResult.Yes Then
        item.Delete()
    End If

End Sub 
public void SelectExample(DTE2 dte)
{
    // Add a new tab to the Toolbox.
    ToolBox box = dte.ToolWindows.ToolBox;
    ToolBoxTab tab = box.ToolBoxTabs.Add("Sample ToolBoxTab");

    // Add two ToolBoxItem objects to the new Toolbox tab.
    ToolBoxItem item = tab.ToolBoxItems.Add("Text Item", 
        "Hello, text item!", 
        vsToolBoxItemFormat.vsToolBoxItemFormatText);
    tab.ToolBoxItems.Add("HTML Item", "Hello, HTML item!", 
        vsToolBoxItemFormat.vsToolBoxItemFormatHTML);

    // Select the "Text Item" ToolBox item.
    box.Parent.AutoHides = false;
    box.Parent.Activate();
    tab.Activate();
    item.Select();

    if (MessageBox.Show("Delete the selected ToolBox item?", "", 
        MessageBoxButtons.YesNo) == DialogResult.Yes)
        item.Delete();
}

.NET Framework 보안

참고 항목

참조

ToolBoxItem2 인터페이스

EnvDTE80 네임스페이스

기타 리소스

방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행