33

I'm trying to change the application icon from default to something else. So what I did, is I made an icon and saved it. Then I went to the application tab in the property of my project and changed the icon. There he shows the icon like I made it, but when I run my project it shows a gray icon instead of showing my icon.

What i'm doing wrong here?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
jorne
  • 894
  • 2
  • 11
  • 23
  • It is the Application icon, in the top left – jorne Apr 19 '12 at 07:34
  • are you running this in Visual Studio? – default Apr 19 '12 at 07:45
  • In summary, there are at least two places the icon is set: one for the application icon; and one for the form. The application icon is set via the project properties application tab / resources / icon and manifest / icon browse button as AlphaMale posted. The form icon (the one in the top left that maybe you referred to in your comment) is set as @Dan posted, by the form properties / windows style / icon property. – sdjuan Jul 08 '17 at 17:50

9 Answers9

39

Run it not through Visual Studio - then the icon should look just fine.

I believe it is because when you debug, Visual Studio runs <yourapp>.vshost.exe and not your application. The .vshost.exe file doesn't use your icon.

Ultimately, what you have done is correct.

  1. Go to the Project properties
  2. under Application tab change the default icon to your own
  3. Build the project
  4. Locate the .exe file in your favorite file explorer.

There, the icon should look fine. If you run it by clicking that .exe the icon should be correct in the application as well.

default
  • 11,485
  • 9
  • 66
  • 102
16

The Icon property for a project specifies the icon file (.ico) that will be displayed for the compiled application in Windows Explorer and in the Windows taskbar.

The Icon property can be accessed in the Application pane of the Project Designer; it contains a list of icons that have been added to a project either as resources or as content files.

To specify an application icon

  1. With a project selected in Solution Explorer, on the Project menu click Properties.
  2. Select the Application pane.
  3. Select an icon (.ico) file from the Icon drop-down list.

To specify an application icon and add it to your project

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Select the Application pane.
  3. Select Browse from the Icon drop-down list and browse to the location of the icon file that you want.

The icon file is added to your project as a content file and can be seen on top left corner.

And if you want to show separate icons for every form you have to go to each form's properties, select icon attribute and browse for an icon you want.

Here's MSDN link for the same purpose...

Hope this helps.

talha2k
  • 24,937
  • 4
  • 62
  • 81
15

If you are using Forms you can use the icon setting in the properties pane. To do this select the form and scroll down in the properties pane till you see the icon setting. When you open the application it will have the icon wherever you have it in your application and in the task bar

Icon settings

Dan
  • 7,286
  • 6
  • 49
  • 114
5

Your application icon shows in the taskbar. The icon on the topleft (window) is the form-icon. Go to your form and fill the property "icon" with the same icon; problem solved. You don't need to put the icon in the outputfolder (that's just for setups).

riffnl
  • 3,248
  • 1
  • 19
  • 32
5

Go to the Project properties Build the project Locate the .exe file in your favorite file explorer.

mirazimi
  • 814
  • 10
  • 11
4

Go to form's properties, ICON ... Choose an icon you want.

EDIT: try this

  1. Edit App.Ico to make it look like you want.
  2. In the property pane for your form, set the Icon property to your project's App.Ico file.
  3. Rebuild solution.

And read this one icons

Likurg
  • 2,742
  • 17
  • 22
  • tried it, but doesn't work. it is the same, it shows my icon in visual studio ok, but not when i run my project. Let me edit that, it show it good in the property but not in the from selve – jorne Apr 19 '12 at 07:37
2

If your designated icon shows when you run the EXE but not when you run it from Visual Studio, then, for a WPF project add the following at the top of your XAML: Icon="Images\MyIcon.ico". Put this just where you have the Title, and xmlns definitions. (Assuming you have an Images folder in your project, and that you added MyIcon.ico there).

Guy
  • 1,232
  • 10
  • 21
0

you should put your icon on the project folder, before build it

MarcoM
  • 92
  • 1
  • 10
0

I had the same problem. I followed the steps to change the icon but it always installed the default icon.

FIX: After I did the above, I rebuilt the solution by going to build on the Visual Studio menu bar and clicking on 'rebuild solution' and it worked!

Scott
  • 55
  • 5