Share via


ToolBoxItems.SelectedItem 속성

도구 상자의 탭에 현재 선택된 항목이 있으면 가져옵니다.

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

구문

‘선언
ReadOnly Property SelectedItem As ToolBoxItem
ToolBoxItem SelectedItem { get; }
property ToolBoxItem^ SelectedItem {
    ToolBoxItem^ get ();
}
abstract SelectedItem : ToolBoxItem with get
function get SelectedItem () : ToolBoxItem

속성 값

형식: EnvDTE.ToolBoxItem
ToolBoxItem 개체

설명

도구 상자 탭에 항목이 없거나 항목을 선택하지 않은 경우에는 SelectedItem에서 Nothing을 반환합니다.

예제

Sub SelectedItemExample(ByVal dte As DTE2)

    ' Before running this example, select an item in the 
    ' ToolBox window.

    Dim tab As ToolBoxTab = dte.ToolWindows.ToolBox.ActiveTab
    Dim item As ToolBoxItem = tab.ToolBoxItems.SelectedItem

    If IsNothing(tab) = False Then
        MsgBox("The selected toolbox item is " & item.Name)
    Else
        MsgBox("No toolbox item is selected")
    End If

End Sub
public void SelectedItemExample(DTE2 dte)
{
    // Before running this example, select an item in the 
    // ToolBox window.

    ToolBoxTab tab = dte.ToolWindows.ToolBox.ActiveTab;
    ToolBoxItem item = tab.ToolBoxItems.SelectedItem;

    if (tab != null)
        MessageBox.Show("The selected toolbox item is " + item.Name);
    else
        MessageBox.Show("No toolbox item is selected");
}

.NET Framework 보안

참고 항목

참조

ToolBoxItems 인터페이스

EnvDTE 네임스페이스

기타 리소스

방법: 도구 상자 제어