Set application icon from resources in VS 05

你。 提交于 2019-12-20 02:36:22

问题


I know I can add a icon to the Resources.resx file of a project and then reference that icon from within the code.

How do I set the icon of the entire EXE from the resources? All I see is a place to browse for another file. I want to use the current icon file that I have in my resources and not have to have a duplicate file in my project...

thanks


回答1:


The way that the adding of an application icon is that you must select it from the local file system, and then it is embedded into the application at build time. As far as I know it is not possible to have it first pull from a resource file.




回答2:


One solution I always use to prevent duplicate file references, is to create a solution folder such as "Project Dependencies". And then all refereces are made from that folder, so when building it pulls from the Project Dependencies folder.

This would work for resource files also, just copy them to the solution folder first and then drag them into your resource.

And for the assembly icon, just browse to the Project Dependencies folder as well.

Good Luck!



来源:https://stackoverflow.com/questions/198848/set-application-icon-from-resources-in-vs-05

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!