Share via


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 包含與資料表相關聯的所有控制項,包括可能因為 、 ColumnCountRowCount 限制而目前未顯示的 GrowStyle 控制項。

適用於

另請參閱