Pergunta

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!

Foi útil?

Solução

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

notico.Icon = Properties.Resources.iconname;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top