Programmatically Retrieve an Image from an Assembly Resource File
As many times as I do this, invariably it slides from my brain and I have to gather all the information I can to do this again. So here it is for my sake as well as others that might have to do this.
A good practice for Windows Forms development is to include most icons/images into an assembly resource file so that they don't show up a separate objects that can be meddled with on the file system when the application is installed. To programmatically access these images in resource files, you can use the properties class.
For example:
this.Icon = Company.ProjectName.Properties.Resources.DesiredImage;
Comments
- Anonymous
June 15, 2009
PingBack from http://mydebtconsolidator.info/story.php?id=2442