共用方式為


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 A 包含與電流 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屬性包含與表格相關的所有控制項,包括因 、 ColumnCountRowCount 限制而暫時無法顯示GrowStyle的控制項。

適用於

另請參閱