WPF:Window Icon

http://msdn.microsoft.com/en-us/library/system.windows.window.icon.aspx

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.

 

 

可以使用程序集级别的icon,也可以自己指定

// Set an icon using code
Uri iconUri = new Uri("pack://application:,,,/WPFIcon2.ico", UriKind.RelativeOrAbsolute);
this.Icon = BitmapFrame.Create(iconUri);
posted @ 2010-01-16 12:00  陈希章  阅读(6021)  评论(0编辑  收藏  举报