Click here to Skip to main content
15,943,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a WinForms program with multiple forms. Depending on the parameters passed at launch time a different form will be run. I would like the form opened to override the icon on the taskbar instead of the default icon from the application.
Posted
Updated 15-Oct-14 10:13am
v2
Comments
BillWoodruff 15-Oct-14 17:55pm    
Are you creating a resource for each Form of Type .ico and executing:

this.Icon = Properties.Resources.iconForFormWhatever;

In each Form's initialization code ?

1 solution

For future reference, a quick google search would have given you the answer. Also, you can learn a lot from intellisense if you would have just typed in your form name and then a dot you would have seen Form.Icon.

See http://stackoverflow.com/questions/15246520/c-sharp-changing-the-icon-of-the-taskbar[^] for example.
 
Share this answer
 
Comments
[no name] 15-Oct-14 15:55pm    
The question is, is that answer really the total truth?
ZurdoDev 15-Oct-14 15:57pm    
Feel free to add your own solution if you have a different way.
[no name] 15-Oct-14 16:02pm    
That was not a criticism, only a note ;)

I don't have "the solution". I came to the same answer with Google...and then I asked myself, maybe there is another way to cheat the Icon for taskbar....
MeritUSA 15-Oct-14 16:00pm    
That doesn't seem to work for me. Every one of the forms has it's own icon already and it displays on the form, but not on the Windows taskbar.
The project icon is the default icon. Depending on the form that is run I want the forms ICON to show on the taskbar not the default project icon.
ZurdoDev 15-Oct-14 16:03pm    
There are several suggestions on that page, for example, if you use a certain borderstyle or if you are doing win 7 or win8.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900