• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

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
0
Murray Brown
Asked:
Murray Brown
  • 3
  • 3
1 Solution
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks wayne. That worked
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now