TableLayoutPanel.Controls 属性

定义

获取包含在 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

属性值

包含与当前 TableLayoutControlCollection 关联的控件的 TableLayoutPanel

属性

示例

下面的代码示例枚举 中的所有 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

注解

属性 Controls 包含与表关联的所有控件,包括当前可能由于 GrowStyleColumnCountRowCount 限制而无法显示的控件。

适用于

另请参阅