Any easy way to use icons from resources?

后端 未结 7 1806
伪装坚强ぢ
伪装坚强ぢ 2020-12-08 18:35

I have an C# app. I need to add an icon to that app so i added an icon resource. Adding resource went fine, but is there any way to use my (resource) icon as form icon WITHO

7条回答
  •  离开以前
    2020-12-08 19:11

    After adding the ICO file to your apps resources, you can use references it using My.Resources.YourIconNameWithoutExtension

    For example if I had a file called Logo-square.ico added to my apps resources, I can set it to an icon with:

    NotifyIcon1.Icon = My.Resources.Logo_square
    

提交回复
热议问题