J
Jerry Spence1
I'm going mad here. I know about creating controls at runtime and creating a
single event etc. In all the examples I have found they create a button and
create an event for it. What I can't fathom out is how to refer to a
non-event control such as a picturebox. I have created them as follows:
For n As Integer = 1 To 10
Dim c As New PictureBox
With c
.Location() = New System.Drawing.Point(35, 30)
.Size = New System.Drawing.Size(225, 175)
.Name = "PictureBox" & Trim(Str(n))
End With
Me.Controls.Add(c)
Next
However, how do I now refer to it?
PictureBox8.Image = System.Drawing.Image.FromFile(MyPath & Filename)
-Jerry
single event etc. In all the examples I have found they create a button and
create an event for it. What I can't fathom out is how to refer to a
non-event control such as a picturebox. I have created them as follows:
For n As Integer = 1 To 10
Dim c As New PictureBox
With c
.Location() = New System.Drawing.Point(35, 30)
.Size = New System.Drawing.Size(225, 175)
.Name = "PictureBox" & Trim(Str(n))
End With
Me.Controls.Add(c)
Next
However, how do I now refer to it?
PictureBox8.Image = System.Drawing.Image.FromFile(MyPath & Filename)
-Jerry