E
Elmo Watson
I've got a subroutine that can do something when the image in the Picturebox
is doubleclicked, that works just fine
Private Sub pb1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles pb1.DoubleClick
ShowImage(pb1)
End Sub
Private Sub ShowImage(ByVal ctrl As Control)
Dim PicForm As New MyForm
Dim img As Image
img = Image.FromFile(ctrl.Tag)
PicForm.LoadFile(img)
PicForm.ShowDialog()
End Sub
Now - Let's say I'm adding a picturebox to a panel, dynamically, and I set
the image dynamically (small image) - but I want to add an event handler, so
that when the small image in the new dynamically created Picturebox is
doubleclicked, it will call that function
Dim picBox as PictureBox= new PictureBox
' How can I change the above code to handle this new dynamically created
control - and then how can I add an event handler to do the same thing for
the new dynamically created control (when double-clicked)?
(I hope this is understandable)
is doubleclicked, that works just fine
Private Sub pb1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles pb1.DoubleClick
ShowImage(pb1)
End Sub
Private Sub ShowImage(ByVal ctrl As Control)
Dim PicForm As New MyForm
Dim img As Image
img = Image.FromFile(ctrl.Tag)
PicForm.LoadFile(img)
PicForm.ShowDialog()
End Sub
Now - Let's say I'm adding a picturebox to a panel, dynamically, and I set
the image dynamically (small image) - but I want to add an event handler, so
that when the small image in the new dynamically created Picturebox is
doubleclicked, it will call that function
Dim picBox as PictureBox= new PictureBox
' How can I change the above code to handle this new dynamically created
control - and then how can I add an event handler to do the same thing for
the new dynamically created control (when double-clicked)?
(I hope this is understandable)