0

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」が表示されました。

4

0 に答える 0