Expanded Property
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

UIHierarchyItems.Expanded Property

Sets or gets whether a node in the hierarchy is expanded.

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

bool Expanded { get; set; }
/** @property */
boolean get_Expanded ()

/** @property */
void set_Expanded (/** @attribute InAttribute() */ boolean pfExpanded)

function get Expanded () : boolean

function set Expanded (pfExpanded : boolean)

Property Value

A Boolean value indicating true the node is expanded, false if not.

Sub ExpandedExample()
   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
Show:
© 2016 Microsoft