Export (0) Print
Expand All
Cut
Run
Expand Minimize

SelectUp Method

Visual Studio .NET 2003

Selects the node immediately above the currently selected node with respect to the tree's current expansion state.

[Visual Basic .NET]
Public Sub SelectUp( _
   ByVal How As vsUISelectionType, _
   ByVal Count As Integer _
) 
[Visual Basic 6]
Sub SelectUp( _
   ByVal How As vsUISelectionType, _
   ByVal Count As Long _
) 
[C++]
HRESULT __stdcall SelectUp(
   vsUISelectionType How,
   long Count
);
[C#]
public void SelectUp(
   vsUISelectionType How,
   int Count
);
[JScript .NET]
public function SelectUp(
   How : vsUISelectionType,
   Count : int
)

Parameters

How
Required. A vsUISelectionType constant indicating how the selection is made.
Count
Required. The number of nodes to select down from the current node. Count is also used for coalescing commands while recording. That is, if you type SHIFT + UP ARROW four times, rather than four lines of code emitted, you instead get one line with a Count value of 4.

Remarks

SelectUp is useful for shift-click macro recording or arrowing down or up. It is useful since the behavior of SelectUp mimics the behavior of using the ARROW and SHIFT + ARROW keys in a tree view.

Example

Sub SelectUpExample()
   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 | SelectDown Method

Applies To: UIHierarchy Object

Show:
© 2014 Microsoft