C
Cokegod
Guest
I just made 5 pic boxes in the form load like this:
Dim b(4) As PictureBox
Dim I As Integer
Dim MyImage As Bitmap
For i = 0 To 4
B(I) = New PictureBox()
MyImage = New Bitmap("C:\Documents and Settings\Geoff\My Documents\Visual Studio Projects\WindowsApplication1\b" & I & ".bmp")
B(I).Image = CType(MyImage, Image)
B(I).Top = 120
B(I).Left = 110 + (I * 50)
B(I).SizeMode = PictureBoxSizeMode.StretchImage
B(I).Height = 45
B(I).Width = 50
Me.Controls.Add(b(I))
Next
And now I am wonder how do i get the click event from these new pics: I tried:
Private Sub B_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b.Click '
but it dosen't recognize my "b" in "Handles b.click"
Thanks for all the help, this forum has been great!
Dim b(4) As PictureBox
Dim I As Integer
Dim MyImage As Bitmap
For i = 0 To 4
B(I) = New PictureBox()
MyImage = New Bitmap("C:\Documents and Settings\Geoff\My Documents\Visual Studio Projects\WindowsApplication1\b" & I & ".bmp")
B(I).Image = CType(MyImage, Image)
B(I).Top = 120
B(I).Left = 110 + (I * 50)
B(I).SizeMode = PictureBoxSizeMode.StretchImage
B(I).Height = 45
B(I).Width = 50
Me.Controls.Add(b(I))
Next
And now I am wonder how do i get the click event from these new pics: I tried:
Private Sub B_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b.Click '
but it dosen't recognize my "b" in "Handles b.click"
Thanks for all the help, this forum has been great!