: ok i am trying to click a button and when i click it , it will change the BackGroundImage. here the code for it .
:
: private void button1_Click_1(object sender, System.EventArgs e)
: {
if (!System.IO.File.Exists("C:\\j.jpeg"))
{
MessageBox.Show("There is no such file as C:\\j.jpeg");
return;
}
: Image image = Image.FromFile("C:\\j.jpeg");
if (!System.IO.File.Exists("C:\\h.jpeg"))
{
MessageBox.Show("There is no such file as C:\\h.jpeg");
return;
}
: Image picture = Image.FromFile("C:\\h.jpeg");
: int i;
: i = 2;
: if( i > 3)
: {
: BackgroundImage = picture;
: }
: else
: BackgroundImage = image;
: }
:
: and then i get this message after it excutes with no errors
: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in system.drawing.dll
: additional information: C:\j.jpeg
: