tags:

views:

250

answers:

1

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:

  • Font Family/Size
  • Margins (In Buttons, windows, groupboxes,..)
  • Paddings
  • Colors (Backgroundcolor,..)
  • etc..
+2  A: 

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

Mihir Gokani