Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Adding resouces to project

$
0
0

I do not have a problem with adding a jpg file to a resource file and accessing this within a WinForm program.

Right-click on project and select Add-->New Item and select Assembly Resource file.

This will add the files resource1.resx and resource1.Designer.resx to the project.

Double-click resource1.resx to open in Resource editor.

Click on drop-down arrow next to Add Resource and Select Add Existing File and then navigate to your jpg files and add them. In my case I added vcproduct.jpg.

Save this.

I can then populate a PictureBox control and a button background with the .jpg using syntax:

          set pictureBox1::Image to type testresource.Resource1::vcproduct

          set button1::BackgroundImage to type testresource.Resource1::vcproduct

Where testresource is the name of my project and therefore the default namespace.

Thanks.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>