views:

27

answers:

3

I have set the icon to use for my application but my form still having the default icon on it. How can I select its icon to be the one set for the application? Please help

+1  A: 

Setting the icon for the application should carry over to all windows, except when overridden.

You may be running the application through Visual Studio, in which case you will be running vshost.exe. Try running your application directly from the Release directory, and you should see the icon appear in your Windows.

Will Eddins
@Will Eddins: With latest update of the VS2010, I can see the icon while debugging. But only if I set it explicitly for the form. Setting from the Project property doesn't work.
Nam Gi VU
A: 

You need to set the Icon for the window explicitly like

<Window x:Class="FFTP.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow"
        Icon="App.ico">
.
.
.
</Window>
Avatar
Would you explain why :) ?
Nam Gi VU
http://msdn.microsoft.com/en-us/library/system.windows.window.icon.aspx Please see the **Note** given in the link. In general, in debug mode the application icon won't display. For that, you need to specify it externally using the `Icon` property.
Avatar
@Avatar: With latest update of the VS2010, I can see the icon while debugging. But only if I set it explicitly for the form. Setting from the Project property doesn't work.
Nam Gi VU
@Nam Gi VU Yeah that is what I mentioned in the above comment. In debugging, the app icon won't be visible on forms unless you specify it externally.
Avatar
@Avatar: You're right!
Nam Gi VU
A: 

If you set it in

Project - Properties - Application - Check Icon and manifest and browse to your icon. It will be set for all Windows in your App. It doesn't work in debug mode however. Try "Start without Debugging"

Also I would recommend IcoFX (Freeware), tried all sorts of paid and unpaid versions of Icon Editors but this was the best by far according to me :)

http://icofx.ro/

Meleak