我动态地将图片框添加到vb.net表单中。但是,当我添加新图片框时,它总是在我之前创建的图片框的下方/下方/后方。是否可以更改它以便新创建的图片框始终位于其他图片框的前面?
由于
答案 0 :(得分:1)
只需将此代码添加到创建图片框的部分
即可PictureBox.BringToFront()
答案 1 :(得分:0)
Dim mypic As PictureBox = New PictureBox
mypic.Height = 13
mypic.Width = 13
mypic.Left = 100
mypic.Top = 100
mypic.Visible = True
mypic.SizeMode = PictureBoxSizeMode.Normal
mypic.Parent = Me
mypic.Image = Image.FromFile("Path of the Image")
Me.Controls.Add(mypic)
mypic.bringtofront()