weixin_40187983
2018-12-05 06:42
采纳率: 73.6%
浏览 1.6k
已采纳

vb.net 用代码产生label panel picturebox,如何将Label置于最上层?

-->产生Panel
Dim panel As New Panel
Dim row As Integer '行数
Dim colume As Integer '行数
If i Mod rowCount > 0 Then
row = i \ rowCount + 1
colume = i Mod rowCount
Else
row = i \ rowCount
colume = rowCount
End If
With panel
.Name = "Panel" + i.ToString()
.Left = (colume - 1) * 520 * rate
.Top = ((row - 1) * 550 * rate) + 10
.Width = 520 * rate
.Height = 525 * rate
.Parent = Me
.BackColor = Color.Blue
End With
Controls.Add(panel)
产生PictureBox
Dim pic() As PictureBox
ReDim pic(1)
pic(1) = New PictureBox

                    这个产生的代码,要置于Panel及PictureBox的最上方,请问代码如何改呢?
                    Dim lab2 As New Label
        With lab2
            .Name = "Lab" + i.ToString()
            .ForeColor = Color.Yellow
            .Font = New System.Drawing.Font("宋体", 20)
            .Text = "2018/1/1"
            .Left = (30 + 260) * rate + (colume - 1) * 500 * rate
            .Top = ((row) * 525 * rate + (row - 1) * 25 * rate) + (-10)
            .Width = 150
            .Height = 30
            .Parent = Me
            .Visible = True
        End With
        Controls.Add(lab2)

                    谢谢
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • 白袍老司机 2018-12-05 08:13
    已采纳

    我也不是很懂,但我想你要是想让他在最上层,那就应该将他包含在panel中,然后panel在picturebox里,大体是这个思路,一层包含一层,被包含的在最上面。仅供参考。

    打赏 评论

相关推荐 更多相似问题