Solved

Change the Image in a Checkbox(button style) when checked.

Posted on 2008-10-28
4
757 Views
Last Modified: 2010-04-21
Hi All.
I am looking to change the image in my Checkbox(button style) to a .jpg I have in the resource file, when it is checked.
I know to use the Image.FromFile("") but I don't know the string of the file if it is in the resource file(other than the complete path), if the program was used on a diff computer the complete path would not be correct(c:\MyComputer\...). How do I access just the resource file?
Thanks...
0
Comment
Question by:Hawkvalley1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
jorgesv13 earned 100 total points
ID: 22824078
You have to add the image to the resources of your project (Resources.resx)
If you do like this, you can access the image with:
My.Resources.myImage
And you will have no need to do "Image.FromFile"
0
 
LVL 27

Expert Comment

by:planocz
ID: 22824129
If you placed the image in the resource tab of your app.
you call it by saying.....
    MyIImage =   My.Resources.MyImage   <-------------- MyImage is the name of your image file
0
 
LVL 27

Expert Comment

by:planocz
ID: 22824135
Sorry,   jorgesv13 said it first.
0
 
LVL 9

Author Closing Comment

by:Hawkvalley1
ID: 31510829
Thanks...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question