Export (0) Print
Expand All

_DTE.SelectedItems Property

Gets a collection containing the items currently selected in the environment.

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

SelectedItems SelectedItems { get; }

Property Value

Type: EnvDTE.SelectedItems
A SelectedItems collection.

public void SelectedItemsExample(DTE2 dte)
{
    // Before running this example, open a project and select some 
    // items in Solution Explorer.

    string msg = "";

    foreach (SelectedItem item in dte.SelectedItems)
        msg += item.Name + "\n";

    MessageBox.Show(
        "The following items are selected in Solution Explorer:\n\n" + 
        msg);
}

Community Additions

ADD
Show:
© 2014 Microsoft