Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-28
4
Medium Priority
?
766 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 400 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Integration Management Part 2
Suggested Courses

916 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