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

Asked

Viewed 50 times

0

I have a picturebox in a User Control, and I want the image of the use control picturebox to go to a picturebox of a form, how to do?

1 answer

0


It’s not hard:

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 disappear after that, just put the line PictureBox1.Image = Nothing at the end of other proceedings.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.