Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SelectedItems (General Extensibility)
ID
Top
Collapse the table of content
Expand the table of content

SelectedItems Property (General Extensibility)

Visual Studio .NET 2003

Returns a collection of all of the currently selected items.

[Visual Basic .NET]
Public ReadOnly Property SelectedItems() As Object
[Visual Basic 6]
Property Get SelectedItems() As Variant
[C++]
HRESULT __stdcall get_SelectedItems(
   /* [out, retval] */ VARIANT* retVal
);
[C#]
public object SelectedItems {get;}
[JScript .NET]
public function get SelectedItems() : Object

Remarks

  • For the TaskList Object, SelectedItems returns a collection (safe array) containing the items currently selected in the Task List.
  • For the UIHierarchy Object, SelectedItems returns a collection (safe array) containing the items currently selected in the tree view. SelectedItems returns the selected items as an array of UIHierarchyItem Objects. This data is a snapshot, however, and is not updated if the status of the UIHierarchy window changes.

Example

Sub SelectionItemsExample()
   ' Before running, open a project and select some items in Solution 
   ' Explorer.
   Dim i As Integer, msg As String
   For i = 1 To DTE.SelectedItems.Count
      msg = msg & DTE.SelectedItems.Item(i).Name & ControlChars.Lf
   Next
   ' List the items selected in Solution Explorer.
   MsgBox(msg)
End Sub

See Also

SelectedItem Object | SelectedItems Collection

Applies To: TaskList Object | UIHierarchy Object

Show:
© 2015 Microsoft