Visual Studio, change app icon, how?

后端 未结 6 598
陌清茗
陌清茗 2020-12-17 17:26

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 chan

相关标签:
6条回答
  • 2020-12-17 18:07

    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.

    0 讨论(0)
  • 2020-12-17 18:09

    I had the exact same problem when I wanted to create an icon for my WinForms program. The following solution worked for me:

    Start creating an icon in i.e. Paint or Photoshop. Make the size preferably 256x256 and 24 bit color. If you use 32 bit color, you won't be able to make the background transparent. Save your image as .png.

    Use your favourite internet browser and enter the page http://iconverticons.com/online/

    This page converts your .png into an .ico-file. Since you had an 256x256 input file, the web application is able to create an .ico-file with sizes from 256, 128, 64, 32, 24 and 16 squared.

    This icon can then be added to your project by right-clicking your projects name in solution explorer -> Properties -> Application. Under the Resources-field, choose Icon and manifest, and press the three dotted button to the right for the icon-combo box. Browse to your icon-file and choose it.

    This will add the icon to your project as you can see when using windows explorer. Note that you have to copy the .exe file from your bin-directory into another directory in order to see the change of icons. This is because the thumbnail icons are not refreshed so easily.

    This will, however, not add the icon to your task bar. In order to do that, go to your Form design window, that is where you can change the graphical appearance of your program. Go to properties and choose "Form1" in the combo box. There you will find an option called Icon. By browsing this property to your .ico-file, you can add the icon file to your program and it will appear on the task bar as well.

    I hope this works for all of you who wants to add an icon to your project. I will add some descriptive images once I get enough rep.points to enable that :-|

    0 讨论(0)
  • 2020-12-17 18:21

    Additional tray icon from resources. Put an appropriate image into the resources and name it icon.

    NotifyIcon tray = new NotifyIcon();
    tray.Icon = Icon.FromHandle(WindowsApplication1.Properties.Resources.icon.GetHicon());
    tray.Visible = true;
    
    0 讨论(0)
  • 2020-12-17 18:22

    I've just suffered from the same problem, 8 years on. It does appear that Windows (7) or Visual Studio (2017) is caching the icon. The only way I can find to clear this cache is with a power cycle.

    0 讨论(0)
  • 2020-12-17 18:26

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

    0 讨论(0)
  • 2020-12-17 18:26

    It has probably nothing to do with Vista. Following shots shows a Windows Form Apploication runnig on Vista. You may have tried same template but using .Net Framwork 2.0. I am not sure but i think .Net Framework 3.0 was not available with VS 2005. You need to set the Forms Icon property.

    0 讨论(0)
提交回复
热议问题