VB net how to send image q is in a user control to a form

0

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?

    
asked by anonymous 29.03.2018 / 00:25

1 answer

0

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.

    
05.05.2018 / 06:19