Domanda

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!

È stato utile?

Soluzione

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

notico.Icon = Properties.Resources.iconname;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top