Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net Can';t动态填充第三列TableLayoutPanel_Vb.net_Tablelayoutpanel - Fatal编程技术网

Vb.net Can';t动态填充第三列TableLayoutPanel

Vb.net Can';t动态填充第三列TableLayoutPanel,vb.net,tablelayoutpanel,Vb.net,Tablelayoutpanel,使用vb 2012,我在一个表中动态创建一个新表,并尝试用标签填充3列,第一列和第二列填充正确,但我无法填充第三列 Dim ctr As New TableLayoutPanel ctr.BackgroundImage = Serials_Downloader.My.Resources.Resources.serialbg ctr.Visible = True ctr.BackColor = Color.Transparent ctr.ColumnCount = 3 ctr.Width = 21

使用vb 2012,我在一个表中动态创建一个新表,并尝试用标签填充3列,第一列和第二列填充正确,但我无法填充第三列

Dim ctr As New TableLayoutPanel
ctr.BackgroundImage = Serials_Downloader.My.Resources.Resources.serialbg
ctr.Visible = True
ctr.BackColor = Color.Transparent
ctr.ColumnCount = 3
ctr.Width = 212
ctr.Height = 64

TableLayoutPanel1.Controls.Add(ctr, 0, TableLayoutPanel1.RowCount - 1)



Dim lblNew2 As New Label()
lblNew2.Text = "a"
lblNew2.ForeColor = System.Drawing.Color.White
lblNew2.Visible = True
lblNew2.TextAlign = ContentAlignment.MiddleCenter
lblNew2.Font = New Font("Decker", 8)
lblNew2.Dock = DockStyle.Fill
ctr.Controls.Add(lblNew2, 0, 0)

Dim lblNew As New Label()
lblNew.Text = "b"
lblNew.ForeColor = System.Drawing.Color.White
lblNew.Visible = True
lblNew.TextAlign = ContentAlignment.MiddleCenter
lblNew.Font = New Font("Decker", 8)
lblNew.Dock = DockStyle.Fill
ctr.Controls.Add(lblNew, 1, 0)

Dim lblNew3 As New Label()
lblNew3.Text = "c"
lblNew3.ForeColor = System.Drawing.Color.White
lblNew3.Visible = True
lblNew3.TextAlign = ContentAlignment.MiddleCenter
lblNew3.Font = New Font("Decker", 8)
lblNew3.Dock = DockStyle.Fill
ctr.Controls.Add(lblNew3, 2, 0)
谢谢你的帮助

编辑:

解决了,


通过将标签宽度从默认值“c”更改为较低的值,出现了。

您能发布完整的代码吗?这基本上是程序这一部分的完整代码,我在表单中添加了TableLayoutPanel1 555x204,它正在从internet删除一些数据,然后将数据添加到TableLayoutPanel1。(创建新的列和行)。它还为创建的每个单元格创建一个新表(ctr),其中有3列包含标签,但是,通过将标签宽度从默认值“c”更改为较低值,这些表中只显示“a”和“b”。