문제

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