Tuesday, 13 August 2013

How can I load an image on button press?

How can I load an image on button press?

I want to load an image from the web when a button is clicked. I have tried:
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.Image = Image.ImageLocation =
"http://i.imgur.com/7ikw7ye.png";
}
But I get the error:
'System.Drawing.Image' does not contain a definition for 'ImageLocation'
If anyone could help me fix this issue or find the correct way to do load
an image when a button is clicked it would be greatly appreciated!

No comments:

Post a Comment