VB.net PictureBox Error

Hi

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?
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi
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
0
Wayne Taylor (webtubbs)Commented:
Try re-building your project.

Wayne
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>
0
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.

Wayne
0

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
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.