views:

1449

answers:

4

Hi,

I am working on a first time C# project in Visual Studio 2005 and I am wondering if there is anything special that needs doing to change the application icon apart from changing the correct resource in the project properties.

I manage to view the new icon displayed in Explorer, but the icon in the application, the tray, and the task bar stays as the old icon.

I am wondering if this has anything to do with Windows Vista perhaps caching the applications icon and from then on not really refreshing it. The same happens in Explorer if you have thumbnails turned on.

If it does indeed cache the icon, what can I do to update/delete the cache, and also what is it based on (GUID perhaps? Not file name though as I changed that and still the same).

Thanks

A: 

does your icon include different sizes: 16x16, 32x32, 48x48 ?
16x16 is used when displaying in taskbar, ...

najmeddine
Well, the thing is I already had an icon, which I simply edited slightly in Visual Studio's icon editor. The new icon displays correctly in Explorer when listing the application in a directory, but the old icon still remains inside the application when running (top-left corner), the tray and task bar.
mr-euro
what image is displayed when you open this new icon in VS icon editor and go to menu: Image->Current Icon Image Types -> 16x16?
najmeddine
32x32 16.7M colours. I think what dbt mentioned is what I am after. It seems as I need to re-import the new icon into the solution.
mr-euro
+1  A: 

Have you tried setting a Form.Icon (Winforms) or Window.Icon (WPF)?

dtb
No, but currently the old icon displays fine. I am trying to replace the old icon with a new one by simply editing it inside the Visual Studio Icon Editor. It does not change all icons though only the one associated to the application.
mr-euro
When you assign an icon to the `Form.Icon` property in Visual Studio, the IDE doesn't make a reference to the file you're adding but copies the file into the `.resx` file associated with the form. To update the icon you have to assign the icon again so Visual Studio updates the copy.
dtb
Cheers dtb, it seems that s where I was going wrong. I located the resx file in question and saw a few images corresponding to each tab in the application. Although when trying to edit/re-import them I get a warning. Still investigating. Thx.
mr-euro
Only missing the tray-bar icon now. Can't seem to find where to change it.
mr-euro
done! thx for the hint about re-importing the icons into the resx.
mr-euro
A: 

The Icon in tray, and the task bar is based on the Form or Window Icon. The application Icon (the one you see in explorer) is set in the properties.

Kris Erickson
The part I am missing then is how does the old icon gets displayed still when I simply have edited the old icon and overwritten it (creating the new icon). Confused...
mr-euro
+2  A: 
Asad Butt
Thanks asdi, this is exactly what I ended up doing. I finally located the icon inside the Properties of the actual form and not the solution.
mr-euro