TableLayoutPanel.Controls 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得包含在 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屬性包含與表格相關的所有控制項,包括因 、 ColumnCount或 RowCount 限制而暫時無法顯示GrowStyle的控制項。