Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

An all new solution/project. A simple windows application form with only a picture box, then i select the image property from the properties window and select an image. Ok, I can see the image in the design, but when i try to run this form, the picture box's image can't show at all (this also happen for the Panel control Background image).

 

And the strangest thing is i'm very SURE these simple tasks were running fine just a few days before. But why suddenly this simplest thing on earth cannot work?? :confused: Did i set something in the environment? A virus attack? Or is it a DotNet bug? Just frustrating! :confused: :confused: Please Help!

  • *Experts*
Posted

Make sure your project is saving the resx file (if you're using C#, click "Show All Files" in the Solution Explorer to see the resx file below the form's cs file).

 

That's the only thing I can think of if everything else is created from a default project with no other tweaks. Do you get an exception, or just no picture?

 

You might also try loading the image at runtime to see if that works - just as a test. In Form_Load, put something like:

imgTest.Image = Bitmap.FromFile(@"c:\temp\image.bmp");

 

If that works, then you likely have something wrong with the resx file(s). Not sure what the cause would be, but at least it's a start.

 

-ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Thanks. Finally got it. I need to save that form with the picture box first then run, the image will be shown. But after that when I change to another image or add another picturebox, I'll need to save the form again before i run the project.

 

Nerseus: There is no exception, just no image shown on the form. Tried to load the image at runtime and it works. Might be the resource file not saved correctly until I save the form, not sure :confused:

 

DiverDan: Thanks, finally have someone who've faced the same problem with me. :-\

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...