Solved

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

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

747 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

12 Experts available now in Live!

Get 1:1 Help Now