質問

i embedded a .ico-File in my Project resources.

Now i want to use this icon as the Tray-Icon of the application.

I used

notico.Icon = new Icon("tanss.ico");

so far, but that depends on the icon file stored in the path of the executable.

How do i access my tanss.ico out of the embedded ressource?

I tried

new Icon(Properties.Resources.iconname);

without success.

Thank you!

役に立ちましたか?

解決

Do not create a new Icon from an Icon. Just use the Properties.Resources.iconname as the Icon instance.

notico.Icon = Properties.Resources.iconname;
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top