UIHierarchyItem.IsSelected 属性

定义

获取指示是否已选择节点的值。

public:
 property bool IsSelected { bool get(); };
public:
 property bool IsSelected { bool get(); };
[System.Runtime.InteropServices.DispId(6)]
public bool IsSelected { [System.Runtime.InteropServices.DispId(6)] get; }
[<System.Runtime.InteropServices.DispId(6)>]
[<get: System.Runtime.InteropServices.DispId(6)>]
member this.IsSelected : bool
Public ReadOnly Property IsSelected As Boolean

属性值

Boolean

指示 true 该项是否处于选定状态的布尔值 false ; 否则为。

属性

示例

Sub IsSelectedExample()  
   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  

适用于