Aracılığıyla paylaş


ToolBoxItems.SelectedItem Özellik

Sekmesinde seçili öğeyi alır araç, herhangi varsa.

Ad alanı:  EnvDTE
Derleme:  EnvDTE (EnvDTE.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property SelectedItem As ToolBoxItem
    Get
ToolBoxItem SelectedItem { get; }
property ToolBoxItem^ SelectedItem {
    ToolBoxItem^ get ();
}
abstract SelectedItem : ToolBoxItem
function get SelectedItem () : ToolBoxItem

Özellik Değeri

Tür: EnvDTE.ToolBoxItem
ToolBoxItem nesnesi

Açıklamalar

Hiçbir öğe varsa araç sekme ya da seçili öğe yok, daha sonra ise SelectedItem verir Nothing.

Örnekler

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 Güvenliği

Ayrıca bkz.

Başvuru

ToolBoxItems Arabirim

EnvDTE Ad Alanı

Diğer Kaynaklar

Nasıl Yapılır: Denetim Araç kutusu