Export (0) Print
Expand All
ID
Top
Expand Minimize

IsSelected Property

Visual Studio .NET 2003

Returns whether a node is selected.

[Visual Basic .NET]
Public ReadOnly Property IsSelected() As Boolean
[Visual Basic 6]
Property Get IsSelected() As Boolean
[C++]
HRESULT __stdcall get_IsSelected(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
[C#]
public bool IsSelected {get;}
[JScript .NET]
public function get IsSelected() : Boolean

Return Value

True if the item is selected, False otherwise.

Example

Sub IsSelectedExample()
   Dim UIH As UIHierarchy = _
     DTE.Windows.Item(Constants.vsWindowKindMacroExplorer).Object
   Dim UIHItem As UIHierarchyItem = UIH.GetItem("Macros\Samples")

   UIHItem.Select(vsUISelectionType.vsUISelectionTypeSetCaret)
   If UIHItem.IsSelected = False Then
      If UIH.UIHierarchyItems.Expanded = True Then
         MsgBox("Node is expanded.")
      Else
         MsgBox("Node is not expanded.")
      End If
   End If
   UIH.SelectDown(vsUISelectionType.vsUISelectionTypeSelect, 2)
   UIH.DoDefaultAction()
   UIH.SelectDown(vsUISelectionType.vsUISelectionTypeSelect, 1)
   UIH.SelectUp(vsUISelectionType.vsUISelectionTypeExtend, 1)
End Sub

See Also

Manipulating Tree Views Using UIHierarchy

Applies To: UIHierarchyItem Object

Show:
© 2014 Microsoft