c# - direct reference to app.ico icon - NO EXTRACT -
i have c# project. choose .ico file in property automatically added .ico list "solution explorer".
i using "notifyicon", , want change icon programmatically. example notifyicon red when program busy , green when free. know have add new embed resource second ico. how access existing 1 application ico?
i "something like"
notifyicon1.icon = appname.greenico.ico; //default app ico notifyicon1.icon = appname.redico.ico; //ico ill add embed resource guess
is possible? saw strange extractico thingy... sure possible reference straight embed ain't it?
found really easy solution. first: change "build" properties of 2 icons in "solution explorer" "embedded ressource".
now in code set 2 icons variables:
public icon greenico = new icon(typeof(mainformname), "greenico.ico"); public icon redico = new icon(typeof(mainformname), "redico.ico");
then use them, easy so:
notifyicon1.icon = greenico;
as simple that. hope it'll else day.
Comments
Post a Comment