Question

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.

Était-ce utile?

La solution 2

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

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top