TablePattern.TablePatternInformation.ColumnCount 속성

정의

테이블에 있는 열의 총 개수를 가져옵니다.Gets the total number of columns in a table.

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

속성 값

Int32

테이블에 있는 열의 총 개수입니다.The total number of columns in a table. 기본값은 영입니다.The default value is zero.

예제

다음 예제에서는 TablePattern 대상 컨트롤에서 가져온 개체를 현재 검색 하는 함수에 전달 TablePattern 속성 값입니다.In the following example, a TablePattern object obtained from a target control is passed into a function that retrieves the current TablePattern property values.

///--------------------------------------------------------------------
/// <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

적용 대상