TablePattern.TablePatternInformation.RowCount Propiedad

Definición

Obtiene el número total de filas de una tabla.

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

Valor de propiedad

Int32

El número total de filas de una tabla. El valor predeterminado es cero.

Ejemplos

En el ejemplo siguiente, un TablePattern objeto obtenido de un control de destino se pasa a una función que recupera los valores de propiedad actuales TablePattern .

///--------------------------------------------------------------------
/// <summary>
/// Gets the current property values from target.
/// </summary>
/// <param name="tablePattern">
/// A TablePattern control pattern obtained from 
/// an automation element representing a target control.
/// </param>
///--------------------------------------------------------------------
private void GetRowColumnCounts(TablePattern tablePattern)
{
    if (tablePattern == null)
    {
        throw new ArgumentException("Target element cannot be null.");
    }

    Console.WriteLine(tablePattern.Current.RowCount.ToString());
    Console.WriteLine(tablePattern.Current.ColumnCount.ToString());
}
'''--------------------------------------------------------------------
''' <summary>
''' Gets the current property values from target.
''' </summary>
''' <param name="tablePattern">
''' A TablePattern control pattern obtained from 
''' an automation element representing a target control.
''' </param>
'''--------------------------------------------------------------------
Private Sub GetRowColumnCounts(ByVal tablePattern As TablePattern)
    If tablePattern Is Nothing Then
        Throw New ArgumentException("Target element cannot be null.")
    End If

    Console.WriteLine(tablePattern.Current.RowCount.ToString())
    Console.WriteLine(tablePattern.Current.ColumnCount.ToString())

End Sub

Se aplica a

Consulte también