I’ve got a form I’d like to change the “skin” on. Clicked on BackgroundImage and imported the two background images I’d like to use then in my code I’ve

private void button3_Click(object sender, EventArgs e)
    {

         skin =!skin;
         if (skin == true)
             BackgroundImage = Image.FromFile("weather picGreen.jpg");
         if(skin== false)
             BackgroundImage = Image.FromFile("weather pic3.jpg");

During debug I’m getting a FileNotFound handling exception
BackgroundImage = Image.FromFile("weather picGreen.jpg");
On this highlighted code. Do I have to add some form of reference?

You probably have to put the full path to the file. If the files are not in the same directory as the executable (which they're generally not if you just hit F5 and run from within Visual Studio), then just putting that file name won't work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.