共用方式為


UIHierarchyItems.Expanded 屬性

設定或取得是否已經展開階層架構中的節點。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
Property Expanded As Boolean
bool Expanded { get; set; }
property bool Expanded {
    bool get ();
    void set (bool value);
}
abstract Expanded : bool with get, set
function get Expanded () : boolean 
function set Expanded (value : boolean)

屬性值

類型:Boolean
布林值,如果節點已展開則會表示為 true,否則為 false。

範例

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

.NET Framework 安全性

請參閱

參考

UIHierarchyItems 介面

EnvDTE 命名空間

其他資源

如何:使用 UIHierarchy 管理樹狀檢視