TablePattern.TablePatternInformation.RowCount 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取表中的总行数。
public:
property int RowCount { int get(); };
public int RowCount { get; }
member this.RowCount : int
Public ReadOnly Property RowCount As Integer
属性值
表中的总行数。 默认值为零。
示例
在以下示例中, TablePattern 从目标控件获取的对象将传递到检索当前 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