Set the icon of a window in WPF
Setting the Icon of a window in WPF is very simple! In your window xaml, you need to put the filename of your icon file in icon attribute, like the following:
Code
<Window x:Class="GUIDGenerator.Window1" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="GUIDGenerator" Height="300" Width="300" Icon="generator.ico" | |
> |
Moreover, please the properties in the icon file. The build action sets to be "Content" and Copy to output directory sets to "Always".
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 16 feedbacks awaiting moderation...
Form is loading...