I have put various files into my application's Resources (pic1, pic2, pic3, etc.). Random images are placed into a picturebox control (pbxPic) on my form. When I click a button I want to identify the path to the picture file being displayed in pbxPic.
I noticed that in the Resources.resx file that each entry has a <value> associated with it that identifies the path.
I was thinking that I could capture the associated value when I loaded the associated resource into my picturebox, but I do not know how to reference it. So for example
I noticed that in the Resources.resx file that each entry has a <value> associated with it that identifies the path.
Code:
...
<data name="pic1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pic1.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pic2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pic2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pic3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pic3.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Code:
dim PicPath as string
pbxPic.image = My.Resources.pic1
PicPath = ????????