如何在VB中动态创建TableLayoutPanel?

时间:2017-01-05 17:02:59

标签: vb.net

我正在尝试通过Windows窗体VB中的代码创建一个tableLayoutPanel,稍后可以对其进行编码,以便通过编码添加额外的行和列

1 个答案:

答案 0 :(得分:0)

表单开始时:

Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _MyBase.Load Dim TLP As New TableLayoutPanel 'Edit all your properties: name, size, location, etc. End Sub

当你点击button1时说:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Controls.Add(TLP) End Sub

希望有所帮助。