PictureBox problem ("MissingMainFestResourceException")

  • Thread starter Thread starter Nikhil
  • Start date Start date
N

Nikhil

Hi All,

I am facing one strange problem with the Picturebox. I have
one picturebox each on my 3-4 forms of the application when I run the
application first forms loads very well but when it loads second form I gets
error "MissingMainFestResourceException".I am unable to figure out the
actual cause of this problem as on 2 forms I don't get any exception and on
one form I get this exception.I have added an image to these pictureboxes at
design time.
I am using MS .net Compact framework and C#.
I did the same in VB.net and never ever got this error.
Any idea ???

Thanks
...NikS
 
Can you post some code indicating the line at which the exception occurs. I
would suspect that the embedded resource name does not match that used in
the code. You can enumerate the array returned by
System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames()

To determine the names of resources contained within your exe or dll.

Peter
 
Hi Peter,

I was getting the error at the following line:

this.picUpload.Image =
((System.Drawing.Image)(resources.GetObject("picUpload.Image")));

But I have a very interesting observation of this problem.When I added
another from and followed the same procedure and also added the same number
of controls with similar name the error didn't occur in the new form and I
could see the image on my picturebox.even earlier I was able to add images
to all the other forms except one or two.

This is really strange.... :(

Regards

...NikS
 
Back
Top