共用方式為


UIHierarchyItems.Expanded Property

Definition

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

public:
 property bool Expanded { bool get(); void set(bool value); };
public:
 property bool Expanded { bool get(); void set(bool value); };
[System.Runtime.InteropServices.DispId(5)]
public bool Expanded { [System.Runtime.InteropServices.DispId(5)] get; [System.Runtime.InteropServices.DispId(5)] set; }
[<System.Runtime.InteropServices.DispId(5)>]
[<get: System.Runtime.InteropServices.DispId(5)>]
[<set: System.Runtime.InteropServices.DispId(5)>]
member this.Expanded : bool with get, set
Public Property Expanded As Boolean

Property Value

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

Attributes

Examples

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  

Applies to