rakete
rakete

Reputation: 3051

Using Microsoft Windows Standard Style in WPF-Window?

Is it posible to use the Microsoft Windows Standard Style in a WPF-window? If I create a normal WPF-Window with a textblock or something like that, the font is very small and not the same like in Microsoft Windows. The background of the window is white. Maybe you can tell me how to use the Style or an information source or things like that, where I can read the settings of a Microsoft Windows Standard window, like:

Upvotes: 2

Views: 1156

Answers (1)

mg007
mg007

Reputation: 2978

If you are looking for the system defined values for your application, have a look at these 3 classes :

Example (from MSDN):

Button btncsharp = new Button();
btncsharp.Content = "SystemFonts";
btncsharp.Background = SystemColors.ControlDarkDarkBrush;
btncsharp.FontSize = SystemFonts.IconFontSize;
btncsharp.FontWeight = SystemFonts.MessageFontWeight;
btncsharp.FontFamily = SystemFonts.CaptionFontFamily;
cv1.Children.Add(btncsharp);

OR, in XAML:

<Button
     FontSize="{x:Static SystemFonts.IconFontSize}"
     FontWeight="{x:Static SystemFonts.MessageFontWeight}"
     FontFamily="{x:Static SystemFonts.CaptionFontFamily}"
     Background="{x:Static SystemColors.HighlightBrush}">
     SystemFonts 
</Button>

Check these links at MSDN for more : System.Windows.SystemFonts, System.Windows.SystemParameters, and System.Windows.SystemColors

Quick Tip : Use Visual Studio IntelliSence to see a list of properties in these class

Upvotes: 3

Related Questions