Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to bind Window background to a theme's Window background color?
    primarykey
    data
    text
    <p>How can I bind the default Window background color of the theme to a Window background?</p> <p>I've tried the following:</p> <pre><code>&lt;Window x:Class="Shell" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Shell" Height="300" Width="300" Background="{DynamicResource WindowBackgroundBrush}" &gt; </code></pre> <p>But the background color renders as black and that does not seem right when using the Luna theme. Using the Luna theme I would expect the beige/brownish color often found in Windows XP.</p> <p><strong>UPDATE:</strong> After reading your answers, playing with <a href="http://blog.wpfwonderland.com/2007/01/02/wpf-tools-stylesnooper/" rel="nofollow noreferrer">StyleSnooper</a> and thinking some more about this I've come to the following conclusion:</p> <p>The Window will use SystemColors.WindowBrush as its background color by default. This color is white in most themes i've tried and that is probably OK. I believe white is also the Window background color in WinForms. However, the default Form background color in WinForms is not Window background but Control. So, if I want that color I have use <code>SystemColors.ControlBrush</code> as pointed out by <a href="https://stackoverflow.com/users/24231/lucas">Lucas</a>. </p> <p>At one point I was trying to achieve the brownish/beige Control color of WinForms on Windows XP. This is probably not possible on Windows Vista since Control color on Vista is kind of gray. Running a WinForms application on Windows Vista will not render it as beige/brownish, but gray. In this case I guess we have to apply our own custom styles to achieve the "original" Windows XP look on Vista. </p> <p>Thanks everyone for helping me sort this out!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload