Solved

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

Posted on 2008-10-28
4
755 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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 …
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now