|
-
May 7th, 2013, 08:05 AM
#1
Thread Starter
Addicted Member
-
May 7th, 2013, 09:05 AM
#2
Re: how to access files added to the project?
Add them to your resources. To do so:
1) Double-Click 'My Project' in the Solution Explorer
2) Click on the resources tab in the left hand column
3) Change the 'Strings' drop-down box to 'Images'
4) Click on the arrow for the 'Add Resources'
5) Click on add existing files
To access the images you'd set the picturebox like this:
Code:
PictureBox1.Image = My.Resources.1
-
May 7th, 2013, 06:57 PM
#3
Thread Starter
Addicted Member
Re: how to access files added to the project?
Thanks dday9.
I followed all the steps, and the image file is added as _1.jpg in the resources window(even though in solution explorer it shows as 1.jpg). Then intellisense completes the statement as "PictureBox1.Image = My.Resources._1", and the picture does not load in the picturebox.
I can use the properties window to choose the image as a project resource and the image loads fine. "PictureBox1.Image = My.Resources.1" results in an error message, "PictureBox1.Image = My.Resources._1" does not, but the image doesn't load.
-
May 7th, 2013, 07:22 PM
#4
Thread Starter
Addicted Member
Re: [RESOLVED] how to access files added to the project?
Ok, works now. I had accidentally put the statement in the picturebox's click event handler, so no image is displayed until I click on it. 
Thanks for your help dday9!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|