TableLayoutPanel.Controls Propriedade

Definição

Obtém a coleção de controles contida dentro do 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

Valor da propriedade

TableLayoutControlCollection

Uma TableLayoutControlCollection que contém os controles associados ao TableLayoutPanel atual.

Atributos

Exemplos

O exemplo de código a TableLayoutPanelseguir enumera todos os controles filho no .

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

Comentários

A Controls propriedade contém todos os controles associados à tabela, incluindo controles que podem não ser exibidos atualmente por causa de GrowStyle, ColumnCountou RowCount limitações.

Aplica-se a

Confira também