TableCellCollection.Count 속성

정의

TableCellTableCellCollection 개체 수를 가져옵니다.

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

속성 값

Int32

TableCellTableCellCollection 개체 수입니다. 기본값은 0입니다.

구현

예제

다음 예제에서는 속성을 사용 하 여 CountTableCellCollection수를 확인 하는 방법을 보여 줍니다. 예제에서 속성은 Cells TableRow 클래스 TableCellCollection 인스턴스입니다.

void Button_Click_Coord(object sender, EventArgs e) 
 {
          
    for (int i=0; i<Table1.Rows.Count; i++) 
    {          
       for (int j=0; j<Table1.Rows[i].Cells.Count; j++) 
       {
                
          Table1.Rows[i].Cells[j].Text = "(" + 
             j.ToString() + ", " + i.ToString() + ")";
       }            
    }
 }
 
Sub Button_Click_Coord(sender As Object, e As EventArgs)
    
    Dim i As Integer
    For i = 0 To Table1.Rows.Count - 1
        Dim j As Integer
        For j = 0 To (Table1.Rows(i).Cells.Count) - 1                
            Table1.Rows(i).Cells(j).Text = "(" & j.ToString() & _
                ", " & i.ToString() & ")"
        Next j
    Next i 
End Sub

설명

에 있는 TableCellCollection셀 수를 확인 하려면이 속성을 사용 합니다. Count 속성은 위를 결정 하기 위해 컬렉션을 반복할 때 종종 사용 됩니다.

적용 대상

추가 정보