Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

GetItem Method

Visual Studio .NET 2003

Returns the item designated by given path.

[Visual Basic .NET]
Public Function GetItem( _
   ByVal Names As String _
) As UIHierarchyItem
[Visual Basic 6]
Function GetItem( _
   ByVal Names As String _
) As UIHierarchyItem
HRESULT __stdcall GetItem(
   BSTR Names,
   /* [out, retval] */ UIHierarchyItem** retVal
public UIHierarchyItem GetItem(
   string Names
[JScript .NET]
public function GetItem(
   Names : String
) : UIHierarchyItem


Required. The names in order from the root leading to subsequent subnodes. The last name in the array is the node returned as a UIHierarchyItem Object.

Return Value

Returns a UIHierarchyItem object.


The path is comprised of node names separated by backslashes (\). If two backslashes are adjacent to one another, they are parsed as a single backslash character that is part of a node name and not a separator.

Note   There is another way to access nodes in a UIHierarchy. For details, see UIHierarchy object.


Sub GetItemExample()
   Dim UIH As UIHierarchy = _
   Dim UIHItem As UIHierarchyItem = UIH.GetItem("Macros\Samples")

   If UIHItem.IsSelected = False Then
      If UIH.UIHierarchyItems.Expanded = True Then
         MsgBox("Node is expanded.")
         MsgBox("Node is not expanded.")
      End If
   End If
   UIH.SelectDown(vsUISelectionType.vsUISelectionTypeSelect, 2)
   UIH.SelectDown(vsUISelectionType.vsUISelectionTypeSelect, 1)
   UIH.SelectUp(vsUISelectionType.vsUISelectionTypeExtend, 1)
End Sub

See Also

Manipulating Tree Views Using UIHierarchy

Applies To: UIHierarchy Object

© 2015 Microsoft