K
Knight
I recently converted to VB Net from VB 6 and having troubles with
adding a PictureBox to the form. I create the picturebox but it
doesn't display on my form. I have tried Controls.Add(pic)
but that doesn't work either. Any Help would be much appreciated .
here is my code so far
Knight
Function CreateSurface(ByVal frm As Form) As PictureBox
Dim pic As New PictureBox
Dim loc As Point
loc.X = frm.Location.X
loc.Y = frm.Location.Y
pic.Name = "surface"
pic.Location = loc
pic.Left = frm.Left
pic.Top = frm.Top
pic.Width = frm.Width
pic.Height = frm.Width
pic.BackColor = Color.Black
pic.Visible = True
pic.Show()
CreateSurface = pic
End Function
adding a PictureBox to the form. I create the picturebox but it
doesn't display on my form. I have tried Controls.Add(pic)
but that doesn't work either. Any Help would be much appreciated .
here is my code so far
Knight
Function CreateSurface(ByVal frm As Form) As PictureBox
Dim pic As New PictureBox
Dim loc As Point
loc.X = frm.Location.X
loc.Y = frm.Location.Y
pic.Name = "surface"
pic.Location = loc
pic.Left = frm.Left
pic.Top = frm.Top
pic.Width = frm.Width
pic.Height = frm.Width
pic.BackColor = Color.Black
pic.Visible = True
pic.Show()
CreateSurface = pic
End Function