1

Can anyone show me how to override the WindowStyle in WPF application? preferablly in XAML.

I'm writing an application and I want to customize the top bar of the window. I know I can change it with , but I'm not able to do any customization with it.

Here is a picture of what I'm thinking. From:

To:

I want to be able to change background color and put my own icons on it.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Fever
  • 251
  • 1
  • 5
  • 12
  • I used the following tutorial to achive something equivalent [Custom Window Chrome in WPF](http://www.youtube.com/watch?v=EuhhL_NF-B0) – Miro Bucko Nov 14 '13 at 08:50

2 Answers2

0

If you are using .NET 4.5, you can access the WindowChrome property of your window. If you are using .NET 3.5 or .NET 4.0, you will need to use a separate library, such as Microsoft.Windows.Shell.dll.

If you do not care about the system minimize animation, you can set ResizeMode to NoResize and WindowStyle to None then draw your custom border.

Ming Slogar
  • 2,327
  • 1
  • 19
  • 41
-1

This requires creating the Window chrome (borders) completely from scratch. For an example, including code, see WPF Custom Chrome Library on CodePlex.

Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
  • Thanks for your reply! The sample you provided was using C#, is there other version of this is written in VB? – Fever Oct 01 '13 at 13:40
  • @Fever Most samples I've seen are C# - you might want to just use an existing library, such as http://mahapps.com/MahApps.Metro/ – Reed Copsey Oct 01 '13 at 17:16