22

I'm trying to change the top left corner icon of the winform from the default one to my icon: enter image description here

I've tried it by going to the Properties of my project, and go into Application, the set my own icon it in "Icon and Manifest".

But after that, it still show the same old default icon. Is there something I done wrong?

user3188978
  • 119
  • 2
  • 15
Coolguy
  • 2,225
  • 12
  • 54
  • 81

4 Answers4

70

Your form has properties associated with it (in design mode, have the focus on your form and click F4). One of the properties is Icon and this is what you're looking for.

The icon you are referring to, in Application Properties, is the icon that will be used in the .EXE generated file.

Ofer Zelig
  • 17,068
  • 9
  • 59
  • 93
7

You can use the icon setted for application using the following code:

    public MainForm()
    {
        InitializeComponent();
        Icon = Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetExecutingAssembly().Location);
    }
Junior
  • 313
  • 5
  • 12
  • 1
    This seems to be a good answer for [a different question](https://stackoverflow.com/questions/25403169/get-application-icon-of-c-sharp-winforms-app) – default locale Mar 03 '17 at 04:03
0

It's quite easy; just right-click your window in the visual studio designer and click on settings then navigate in the settings sidebar to the icon section - click on the three dots and select a .ico file as your icon to be displayed in the top left corner of you application.

0

Make Sure that Photo you're choosing is .ico format then you can change simply change it in visual studio form properites.

  • 1
    Welcome to Stack Overflow. Before answering an old question ensure your answer adds something new or is otherwise helpful in relation to them. Here is a guide on [How to Answer](http://stackoverflow.com/help/how-to-answer). – help-info.de Sep 02 '20 at 09:58