I have a picturebox in a User Control, and I want that when I click on it, the picture of the picture of the control use go to a picturebox of a form, how to do it?
I have a picturebox in a User Control, and I want that when I click on it, the picture of the picture of the control use go to a picturebox of a form, how to do it?
It's not difficult:
Public Sub PictureBox1_Click(ByVal sender As Object, e As EventArgs) Handles PictureBox1.Click
' Desabilita verificação cross-thread
Control.CheckForIllegalCrossThreadCalls = False
' Altera no controle do Form
Form1.PictureBox1.Image = PictureBox1.Image
' sendo Form1 o nome da sua form destino
End Sub
If you want the image to add after that, just put the line PictureBox1.Image = Nothing
at the end of the other sources.