Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 769
  • Last Modified:

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

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
Hawkvalley1
Asked:
Hawkvalley1
  • 2
1 Solution
 
jorgesv13Commented:
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
 
planoczCommented:
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
 
planoczCommented:
Sorry,   jorgesv13 said it first.
0
 
Hawkvalley1Author Commented:
Thanks...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now