TableLayoutPanel.Controls Właściwość

Definicja

Pobiera kolekcję kontrolek zawartych w obiekcie 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

Wartość właściwości

TableLayoutControlCollection

Element TableLayoutControlCollection zawierający kontrolki skojarzone z bieżącym TableLayoutPanelelementem .

Atrybuty

Przykłady

Poniższy przykład kodu wylicza wszystkie kontrolki podrzędne w pliku 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

Uwagi

Właściwość Controls zawiera wszystkie kontrolki skojarzone z tabelą, w tym kontrolki, które mogą nie być obecnie wyświetlane z GrowStylepowodu ograniczeń , ColumnCountlub RowCount .

Dotyczy

Zobacz też