hey guys, I am trying to change a PictureBox's image...
This stuff works:
m_CardImg = new PictureBox();
m_CardImg.Image = cardGame.Properties.Resources.b1fv;
This stuff does not work:
string newImageLink = "b1fv";
m_CardImg = new PictureBox();
m_CardImg.Image = cardGame.Properties.Resources + newImageLink;
I am trying to change the Resources bitmap image called b1fv using a variable called newImageLink (which contains a string version of it).
Thank you in advance for your help!
Loading
Krishnaraj LPosted Jun 29, 2006, 8:28 AM
Please try this code. it should work.
This stuff does not work:
string newImageLink = "give a file name here";
//m_CardImg = new PictureBox(); -- No need to allocate it again
//m_CardImg.Image = cardGame.Properties.Resources + newImageLink; -- Your code
m_CardImg.Image = Image.FromFile ("
Hope this helps.
Regards,
Krishnaraj