Bagikan melalui


TableLayoutPanel.Controls Properti

Definisi

Mendapatkan kumpulan kontrol yang terkandung dalam TableLayoutPanel.

public:
 property System::Windows::Forms::TableLayoutControlCollection ^ Controls { System::Windows::Forms::TableLayoutControlCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Windows.Forms.TableLayoutControlCollection Controls { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Controls : System.Windows.Forms.TableLayoutControlCollection
Public ReadOnly Property Controls As TableLayoutControlCollection

Nilai Properti

Yang TableLayoutControlCollection berisi kontrol yang terkait dengan .TableLayoutPanel

Atribut

Contoh

Contoh kode berikut menghitung semua kontrol anak di TableLayoutPanel.

private void enumerateChildrenBtn_Click(
    System.Object sender, 
    System.EventArgs e)
{
    foreach ( Control c in this.TableLayoutPanel1.Controls )
    {
        Trace.WriteLine(c.ToString());
    }
}
Private Sub enumerateChildrenBtn_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles enumerateChildrenBtn.Click

    Dim c As Control
    For Each c In Me.TableLayoutPanel1.Controls

        Trace.WriteLine(c.ToString())

    Next

End Sub

Keterangan

Properti Controls berisi semua kontrol yang terkait dengan tabel, termasuk kontrol yang mungkin saat ini tidak ditampilkan karena GrowStyle, , ColumnCountatau RowCount batasan.

Berlaku untuk

Lihat juga