Question

Hi how can i set image source to an image in winforms?

my images are in Resources folder in the application only

I tried like this

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

But it is showing file not found exception.

Thanks in advance

Was it helpful?

Solution

If the image is in your application's resources, you can do that :

pb.Image = Properties.Resources.a

OTHER TIPS

pictureBox1.Image = Properties.Resources.[image name];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top