This documentation is archived and is not being maintained.

DoDefaultAction Method

Visual Studio .NET 2003

Performs in the hierarchy the same action as if the user had double-clicked or pressed ENTER.

[Visual Basic .NET]
Public Sub DoDefaultAction() 
[Visual Basic 6]
Sub DoDefaultAction() 
[C++]
HRESULT __stdcall DoDefaultAction();
[C#]
public void DoDefaultAction();
[JScript .NET]
public function DoDefaultAction()

Example

Sub DoDefaultActionExample()
   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: UIHierarchy Object

Show: