toyumail Posted May 18, 2004 Posted May 18, 2004 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! Quote
*Experts* Nerseus Posted May 18, 2004 *Experts* Posted May 18, 2004 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 Quote "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
*Experts* DiverDan Posted May 19, 2004 *Experts* Posted May 19, 2004 This has happened to me also...I found that rebuilding the project fixed the lost image problem. Dan Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
toyumail Posted May 20, 2004 Author Posted May 20, 2004 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. :-\ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.