Export (0) Print
Expand All
ID
Top
Expand Minimize

Expanded Property

Visual Studio .NET 2003

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

[Visual Basic .NET]
Public Property Expanded() As Boolean
[Visual Basic 6]
Property Get Expanded() As Boolean
Property Let Expanded( _
   ByVal NewValue As Boolean _
) 
[C++]
HRESULT __stdcall get_Expanded(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
HRESULT __stdcall put_Expanded(
   /* [in] */ VARIANT_BOOL NewValue
);
[C#]
public bool Expanded {get; set;}
[JScript .NET]
public function get Expanded() : Boolean
public function set Expanded(
   NewValue : Boolean
)

Parameters

Expanded
Required. Indicates whether a node in the tree is expanded. A value of True means the node is expanded.

Return Value

True the node is expanded, False if not.

Example

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

See Also

Manipulating Tree Views Using UIHierarchy

Applies To: UIHierarchyItems Collection

Show:
© 2014 Microsoft