_DTE.SelectedItems Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a collection containing the items currently selected in the environment.
public:
property EnvDTE::SelectedItems ^ SelectedItems { EnvDTE::SelectedItems ^ get(); };
[System.Runtime.InteropServices.DispId(213)]
public EnvDTE.SelectedItems SelectedItems { [System.Runtime.InteropServices.DispId(213)] get; }
[<System.Runtime.InteropServices.DispId(213)>]
[<get: System.Runtime.InteropServices.DispId(213)>]
member this.SelectedItems : EnvDTE.SelectedItems
Public ReadOnly Property SelectedItems As SelectedItems
Property Value
A SelectedItems collection.
- Attributes
Examples
Sub SelectedItemsExample(ByVal dte As DTE2)
' Before running this example, open a project and select some items
' in Solution Explorer.
Dim item As SelectedItem
Dim msg As String
For Each item In dte.SelectedItems
msg &= item.Name & vbCrLf
Next
MsgBox("The following items are selected in Solution Explorer:" & _
vbCrLf & vbCrLf & msg)
End Sub
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);
}