Usually I have to set 2 different icons. One in the project's settings tab, and one to the Icon
property of main window. Is there a way to define single icon for the whole application (all windows and exe)?
Update: to be more concrete. I have app that is 100kb in size. I want to embed icon that is 300kb in size and want my app to be 400kb instead of 700
1] Right-click the folder and select 'Properties' in the context menu. 2] Select 'Customize' and hit 'Change Icon' in the Properties window. 3] You can replace the folder icon with a basic/personalized icon. 4] Now click 'OK' to save the changes.
click the select file button. Select your . ico file and press open, then you can name the icon resource to your choosing. Afterwards press 'Add Resource' this will add an icon to your exe file.
You need to set the icon in you project's properties:
For taskbar you need to change your main window's Icon:
When you set your exe icon, WPF will use that for all Windows you create. However, it doesn't do it in debug mode - that's because the "entry point" for your process is the .vshost.exe, not your exe. But if you use Ctrl+F5 (run without debugging), you should find all Windows get the exe icon. You shouldn't have to set it on each Window.
To make it work properly in debug mode, I generally set up a Style which I apply to each window, which sets the application icon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With