views:

80

answers:

1

I am have some trouble specifying a custom icon in my WPF applicaion. I went to Properties/Application and down in resource I pointed towards where the icon is stored (Resources/MyIcon.ico). However when I run the app I get the default icon.

Has anyone else seen similar problems?

+2  A: 

The icon shown in the taskbar and on a form is the icon associated with the form, not the application. (After all, two forms can have two different icons)

You need to change the Icon property of your main Window in XAML.

SLaks
Savage, thanks that worked perfect. Thanks for your help m8
Don
-1 because that's not quite correct; each window's icon can be specified, but if it's not specified it is taken from the Application icon. However, in debug mode the app icon is not visible because of the VS hosting process (see the MSDN page, http://msdn.microsoft.com/en-us/library/system.windows.window.icon(v=VS.100).aspx). I'm sure I got it working in debug mode as well (without turning off the hosting process) but don't remember how. Anyway, if you set the app icon, all the windows in the application will have it by default when running outside VS.
Alex Paven