VB.net PictureBox Error


I have several PictureBoxes on a Windows form. For aech I import an image that gets loaded into resources. Sometimes I have to change the image in one of the PictureBoxes so I import a different image.
I then go and delete the image that I had previously used from resources and this causes errors. I don't understand why this happens and how do I prevent this
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wayne Taylor (webtubbs)Commented:
What errors? Where do the errors occur?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
I get the error "Invalid resx file. Could not find file 'C:\........\Resources\Pic1.png',Line 204,Position 5

and this occurred because I orginally imported the image by clicking on the image property of my picture box. Then I decided that I wanted to change to the picture to pic 2, which I imported. I then right clicked on Resources under my project and deleted Pic1, which resulted in the error
Wayne Taylor (webtubbs)Commented:
Try re-building your project.

Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
 Hi. That didn't help. When I click on the error it takes me to the following line. The SortByProduct.png image is the one I deleted

<data name="SortByProduct" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..\Resources\SortByProduct.jpg;System.Drawing.Bitmap, System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
Wayne Taylor (webtubbs)Commented:
Go to your Project Properties > Resources tab, and remove the offending file. All removing of resources should be done from there, not from the Soltuion Explorer.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks wayne. That worked
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.