2011-02-28 113 views
0

我動態地將圖片框添加到vb.net窗體。但是,當我添加新圖片框時,它始終位於我以前創建的圖片框的下方/下方/後面。是否有可能改變它,使新創建的圖片盒總是在其他人面前?更改vb.net控件的佈局順序

感謝

回答

1

就在這個代碼添加到創建部分pictureboxes

PictureBox.BringToFront() 
+0

謝謝!它完美的工作! – Johan

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