Home > Blockchain >  Exporting exe with custom icon
Exporting exe with custom icon

Time:10-28

So I can already export a visual studio c# program to a single file exe. What I was curious about is if anyone knows of the console tag for adding a image to the exe or if I would have to do that in the properties beforehand. I tried in properties and it didn't work but any opinions would be great thanks.

CodePudding user response:

XAML

<Window x:Class="WindowSample.MainWindow"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    Title="WPF Window Sample" Height="350" Width="525"  
 Name="FirstWindow" Icon="Icon1.ico" >  

I believe all you have to do is add Icon="" to your <Window>

In this example the custom icon file is in the project folder, and its named "Icon1.ico".

  • Note that the icon image file has to be a .ico file.
  • Also note that the Icon file location can be changed to your preferences.

If you want even more help you should consider checking out Properties page

In addition if you would create a setup project and add shortcut to the desktop then you have to separately select an icon for the shortcut. Setup package

  • Related