Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Icon for all app windows

Tags:

icons

window

wpf

It is possible to set one Icon so, that it would be used on every window in current app. So that i set it once (not on every window by hand)..?

like image 554
vts123 Avatar asked Dec 10 '09 15:12

vts123


2 Answers

A good reference on the subject is here MSDN. States that you have an Icon for the Application (Desktop Icon), and one for each Window.

A WPF window always displays an icon. When one is not provided by setting Icon, WPF chooses an icon to display based on the following rules:

  1. Use the assembly icon, if specified.

  2. If the assembly icon is not specified, use the default Microsoft Windows icon.

Community Content Reference:

"A liitle tip : if you set the application icon and expect to see it on the window - it wont show up if running in debug from VS. Running externally or without attaching (ctrl + f5) the icon displays as expected."

like image 125
jsmith Avatar answered Sep 16 '22 15:09

jsmith


Set the icon in the project properties on the "Application" tab in the "Resources" section. This icon will be the default icon for all windows in the application.

like image 36
John Myczek Avatar answered Sep 17 '22 15:09

John Myczek