user541597
user541597

Reputation: 4345

C# Application icon changing docked icon

I have set the application icon under project properties Application tab, Resources, Icon and manifest to a custom icon. However it only changes the icon I see before I open the application. However when I open my application and look at the icon on my dock it is the same icon that I had when debugging with VS 2010.

Here is the image for the icon before I launch.

enter image description here

That is the icon that I want my docked icon to have also however it shows this one...

enter image description here

Upvotes: 0

Views: 511

Answers (4)

Salman
Salman

Reputation: 1380

You have to set the icon for each form.

Upvotes: 0

Julien Roncaglia
Julien Roncaglia

Reputation: 17837

The shell display the icon of windows, not of executalbles, you need to select an icon for the window that is displayed.

In WPF the default icon for a window is the icon of the application, but it seem to only work in Release (See WPF Icon for all app windows ) without a debugger attached. You could still set the icon property of the window to what you want (Directly or from a resource, as you wish):

<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  Icon="SomeIcon.ico">
</Window>

In winforms the designer is the simpler way to do it as it wil automaticaly put it in a resource file or let you select from an existing resource. If you want to to it by hand see Form.Icon documentation.

Upvotes: 0

BlueCacti
BlueCacti

Reputation: 10800

Click on your form
Go to the properties window, go to Icon, select your ccon from the Resources

Upvotes: 0

aquinas
aquinas

Reputation: 23786

You've probably only set the icon for the application, not the icon for your form. Each form can have its own icon.

Upvotes: 2

Related Questions