RowDefinitionCollection.Count プロパティ

定義

RowDefinitionCollection のこのインスタンス内にある項目の合計数を取得します。

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

プロパティ値

Int32

コレクション内の項目の合計数。 このプロパティには既定値はありません。

実装

次の例では、プロパティの使用方法を Count 示します。

private void rowCount(object sender, RoutedEventArgs e)
{
    tp2.Text = "The current number of Rows is: " + grid1.RowDefinitions.Count;
}
Private Sub rowCount(ByVal sender As Object, ByVal e As RoutedEventArgs)
    tp2.Text = "The current number of Rows is: " + grid1.RowDefinitions.Count.ToString()
End Sub

完全なサンプルを表示するには、「 方法: ColumnDefinitionsCollections と RowDefinitionsCollections を使用して列と行を操作する」を参照してください。

注釈

RowDefinitionCollection では、0 から始まるインデックス作成システムが使用されます。

適用対象

こちらもご覧ください