Solved

Need to load images into a picturebox from resources folder C#

Posted on 2014-07-22
3
2,081 Views
Last Modified: 2014-07-23
I'm using a couple of panels stacked on each other When you select something one panel is invisible then the next one appears I wrote it in VB.NET but ran it through a C# Converter. I get an error MissingManifestResourceException was unhandled. I have a Resources Folder with all graphics to be loaded
anyway the line it get hung up on is

picsport.Image = global::My.Resources.Resources.BASEBALL);

Does anyone have an Idea is it a syntax error?
Errormessage.png
0
Comment
Question by:powerztom
3 Comments
 
LVL 16

Accepted Solution

by:
Vikram Singh Saini earned 400 total points
Comment Utility
There are different possibilities -

1. Since you had converted the VB application to C#, so one suspect is that use of My keyword might be wrong in first place.

I would rather suggest you to use the project's namespace as -

global::Namespace.Resources.Resources.BASEBALL;

2. Please also visit the link - System.Resources.MissingManifestResourceException which suggest ways to fix.

3. What I use to do generally? Right click on image or icon file in Resources folder. Set it as resource. And then try to use as -

// First bold resource is name of folder in which image is residing
Namespace.Resources.Resources.BASEBALL;
0
 
LVL 1

Assisted Solution

by:Sameer Rakshe
Sameer Rakshe earned 100 total points
Comment Utility
The path should be something like: "Images\a.bmp". (Note the lack of a leading slash, and the slashes being back slashes.)

And then:

pictureBox1.Image = Image.FromFile(@"Images\a.bmp");
0
 

Author Closing Comment

by:powerztom
Comment Utility
Both EE Experts pointed me in the right direction I was able to fix the problem by right clicking on Resources.resx and Settings.settings in the C# solution, and choosing “Run custom tool”.   Then I reran the C# program, navigated around, and didn’t get the error.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now