I need to change the icon in the application I am working on. But simply browsing for other icons from the project property tab -> Application -> Icon, it is not getting the icons stored on the desktop..
What is the right way of doing it?
I need to change the icon in the application I am working on. But simply browsing for other icons from the project property tab -> Application -> Icon, it is not getting the icons stored on the desktop..
What is the right way of doing it?
The icons you are seeing on desktop is not a icon file. They are either executable files .exe or shortcuts of any application .lnk. So can only set icon which have .ico extension.
browse for your Icon, remember it must have .ico extension
You can make your icon in Visual Studio
Add your icon as a Resource (Project > yourprojectname Properties > Resources > Pick "Icons from dropdown > Add Resource (or choose Add Existing File from dropdown if you already have the .ico)
Then:
this.Icon = Properties.Resources.youriconname;
The Simplest solution is here: If you are using Visual Studio, from the
Solution Explorer
, right click on your project file. ChooseProperties
. SelectIcon and manifest
then Browse your.ico
file.Select your project properties from Project Tab Then Application->Resource->Icon And Manifest->change the default icon
This works in Visual studio 2019 finely Note:Only files with .ico format can be added as icon
I added the .ico file to my project, setting the Build Action to Embedded Resource. I specified the path to that file as the project's icon in the project settings, and then I used the code below in the form's constructor to share it. This way, I don't need to maintain a resources file anywhere with copies of the icon. All I need to do to update it is to replace the file.
You can change the app icon under project properties. Individual form icons under form properties.