开发者

Changing the layout order of vb.net controls

I dynamically add picture boxes to a vb.net form. However, when I add the new picture box, it 开发者_Python百科is always under/below/behind the picture boxes that I previously created. Is it possible to change it so that the newly created picture box would always be in front of the others?

Thanks


Just add this code to the part that creates the pictureboxes

PictureBox.BringToFront()


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()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜