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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -