AutomationElementCollection.Count 屬性

定義

取得此集合中項目的數目。

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

屬性值

Int32

項目的數目。

實作

範例

下列範例顯示正在使用的屬性 Count

// elementCollection is an AutomationElementCollection.
AutomationElement[] elementArray = new AutomationElement[elementCollection.Count];
elementCollection.CopyTo(elementArray, 0);
' elementCollection is an AutomationElementCollection.
Dim elementArray(elementCollection.Count) As AutomationElement
elementCollection.CopyTo(elementArray, 0)

適用於