Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have two pictureboxes in two different forms.

  • Form1 : firstpicturebox
  • form2 : picturebox1

I want to transfer the image of firstpicturebox to picturebox1.

So, can anyone help and provide the solution for the same.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
127 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can send it using Form2 Constructor

Try This:

Form1:

Form2 form2 = null;

private void button1_Click(object sender, EventArgs e)
    {
        form2 = new Form2(pictureBox1.Image);
        form2.Show();
    }

Form 2:

public Form2(Image pic1)
    {
        InitializeComponent();
        pictureBox1.Image = pic1;
    }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...