Winforms image

Hi, how can I set the image source to image in winforms?

my images are in the Resources folder only in the application

I tried like this

PictureBox pb = new PictureBox (); pb.Image = Image.FromFile ("Resources / a.gif");

But it shows an exception not found.

Thank you in advance

+4
source share
2 answers

If the image is in your application resources, you can do this:

pb.Image = Properties.Resources.a 
+12
source
 pictureBox1.Image = Properties.Resources.[image name]; 
+1
source

All Articles