How to change title bar image in WPF Window?

后端 未结 6 2067
太阳男子
太阳男子 2020-12-14 14:58

How to change the titile bar image (the top-left most icon) in WPF?

6条回答
  •  囚心锁ツ
    2020-12-14 15:14

    
    
    

    or in code

    // Set an icon using code
    Uri iconUri = new Uri("pack://application:,,,/WPFIcon2.ico", UriKind.RelativeOrAbsolute);
    this.Icon = BitmapFrame.Create(iconUri);
    

    Source: Window.Icon Property

提交回复
热议问题