C
Code Guy
Hello,
I am trying to execute the following code:
private void button1_Click(object sender, System.EventArgs e)
{
PictureBox c = new PictureBox();
c.BorderStyle = BorderStyle.FixedSingle;
this.Controls.Add(c);
ResourceManager rm =
ResourceManager.CreateFileBasedResourceManager("win1", ".", null);
c.Image = (Image)rm.GetObject("TWOSPADES");
}
I am receiving the error: specified cast is not valid.
I know the GetObject call returns an object because I can view it's
properties. I don't understand why I cannot cast the object into an Image
type. Any help would be appreciated.
Thanks
--
I am trying to execute the following code:
private void button1_Click(object sender, System.EventArgs e)
{
PictureBox c = new PictureBox();
c.BorderStyle = BorderStyle.FixedSingle;
this.Controls.Add(c);
ResourceManager rm =
ResourceManager.CreateFileBasedResourceManager("win1", ".", null);
c.Image = (Image)rm.GetObject("TWOSPADES");
}
I am receiving the error: specified cast is not valid.
I know the GetObject call returns an object because I can view it's
properties. I don't understand why I cannot cast the object into an Image
type. Any help would be appreciated.
Thanks
--