Click here to Skip to main content
13,090,426 members (49,149 online)
Rate this:
Please Sign up or sign in to vote.
See more:

hey guy am trying to get an image which is on a picturebox
to get it on another form picturebox.

i got a picturebox on form1 which is pictureBox1
and i got form2 with pictureBox3 and i want the image which is on pictureBox1 to show on PictureBox3 on form2

i have tried this code
pictureBox3.Image.Clone = new Form1.picturebox1.image();
Posted 3-Dec-12 4:14am
Mendor81 3-Dec-12 10:46am
where does the image come from? if it's from a file then just reload it on the other form.
you could also save it to a temporary image file and reload it this way

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Create a property on Form2 which sets the Image on it's PictureBox:
public Image Image
   get { return myPictrueBox.Image; }
   set { myPictureBox.Image = value; }
Then set it via the instance of Form2 that you create in Form1:
Form2 f = new Form2();
f.Image = myForm1PictureBox.Image;
Mendor81 3-Dec-12 10:49am
I would have suggested that one next, should type faster next time ;P

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100