Click Events for Images at Run-Time

  • Thread starter Thread starter simchajoy2000
  • Start date Start date
S

simchajoy2000

Hi,

I need to create a vb.net windows program that allows users to create
copies of an image when a button is clicked and then allow them to
place the image on any point in the user interface. I am still trying
to figure out how to do that (so any suggestions on how to do that
would be welcome) - but the main thing I am confused about is how I
can then attach a click event to those images when they only get
created at run-time by the user. Could anyone point me in the right
direction for how to do this? Thanks in advance!!

Joy
 
something to help you on the way...


Public Sub AddPicture()
Dim picture As New PictureBox
'set picture properties, add picture to form or so...
AddHandler picture.Click, AddressOf PictureClick
End Sub

Private Sub PictureClick(ByVal source As Object, ByVal e As EventArgs)
MsgBox("Picture clicked")
End Sub
 
Oh thank you! That helps a lot! I really appreciate you taking the
time to help me out! Just a quick question - is it possible to add a
handler for picture.doubleclick?

Joy
 
Alright, I was able to track down the rest of your code and it works beautifully. Thanks you so much - I am very grateful

Joy
 
Back
Top