Partager via


TableLayoutPanel.Controls Propriété

Définition

Obtient la collection de contrôles contenus dans le 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

Valeur de propriété

Contenant TableLayoutControlCollection les contrôles associés à l’élément actif TableLayoutPanel.

Attributs

Exemples

L’exemple de code suivant énumère tous les contrôles enfants dans le 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

Remarques

La Controls propriété contient tous les contrôles associés à la table, y compris les contrôles qui peuvent ne pas être affichés actuellement en raison de GrowStyle, ColumnCountou RowCount des limitations.

S’applique à

Voir aussi