Click here to Skip to main content
15,889,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to set the windows icon property? That icon will then be used as the icon shown in the taskbar as well.

I didn't set application Icon using Icon Property. But I want to do it in programmatically. When I hover the application in task bar. it has to display.

Using Windows form C# application.

What I have tried:

Give me an idea to achieve this task.
Posted
Updated 15-Feb-18 22:37pm
v2

Try this, e.g. in the form constructor:
public Form1()
{
    InitializeComponent();

    using (var stream = File.OpenRead("Test.ico"))
    {
        this.Icon = new Icon(stream);
    }
}
 
Share this answer
 
Comments
Santosh Kokatnur 16-Feb-18 5:41am    
Hi, Rick

I need to show it in taskbar hover, For instance, a visual window will open when i hover the pinned application on my taskbar. on that the icon will be display at the left top corner.

I need not to show on the application when it is maximize. but when i minimize the form and hover on the pinned application. that time it would display at the left top corner.
Here is a list of the Codeproject resources[^] on that topic
 
Share this answer
 
Comments
Santosh Kokatnur 16-Feb-18 5:41am    
Hi CHill60,

Thank you!

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