Question Get Path to Resource File

pjfatboy

Active member
Joined
Nov 30, 2012
Messages
35
Programming Experience
Beginner
In my project I have some picture boxes that have images in them from my Resource Folder. I want to get the path to that image in my Resource Folder and put the path in a text box. I'm not sure how to do that. This is what I have tried so far. Could someone tell me where I am going wrong? Thanks
VB.NET:
[FONT=Arial][SIZE=2][COLOR=#0000ff][FONT=Arial][SIZE=2][COLOR=#0000ff][FONT=Arial][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Arial][SIZE=2][FONT=Arial][SIZE=2]fullPath[/SIZE][/FONT][/SIZE][/FONT][FONT=Arial][SIZE=2][COLOR=#0000ff][FONT=Arial][SIZE=2][COLOR=#0000ff][FONT=Arial][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Arial][SIZE=2][COLOR=#0000ff][FONT=Arial][SIZE=2][COLOR=#0000ff][FONT=Arial][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][B][FONT=Arial][SIZE=2][FONT=Arial][SIZE=2] = [/SIZE][/FONT][/SIZE][/FONT][/B][FONT=Arial][SIZE=2][COLOR=#2b91af][FONT=Arial][SIZE=2][COLOR=#2b91af][FONT=Arial][SIZE=2][COLOR=#2b91af]Path[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][B][FONT=Arial][SIZE=2][FONT=Arial][SIZE=2].[/SIZE][/FONT][/SIZE][/FONT][/B][FONT=Arial][SIZE=2][FONT=Arial][SIZE=2]GetFullPath[B]([/B]PictureBox1[B].[/B]BackgroundImage[B].[/B]ToString[B])[/B][/SIZE][/FONT][/SIZE][/FONT]
[FONT=Arial][SIZE=2][FONT=Arial][SIZE=2]ImageLocationTbx[B].[/B]Text[B] = [/B]fullPath
[/SIZE][/FONT][/SIZE][/FONT]
 
There is no path. Image objects doesn't have paths. Resources also doesn't have paths, they are compiled as resource objects into the assembly. Resources do have a string name, but not one that can be used as a path for example to a PictureBox.ImageLocation.
 
Back
Top