Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to disable XP themes in WPF application?
    primarykey
    data
    text
    <p>I have a WPF application (.NET 3.0, VS2008) that displays data in a tab control. Custom colors are required on virtually all controls in this application : basically white foreground and green background.</p> <p>My problem is that when an XP theme (say Luna) is active, it is automatically applied to render controls so that my white text is written on ... a white background. For instance on the active tab item header : <img src="https://lh6.ggpht.com/_dR4_IBKyRV0/Sf7kTth9ZaI/AAAAAAAAAD8/sUrspncvXek/s800/Sigp3d-WPF-Luna.png" alt="Unreadable tab item header"></p> <p>I have tried :</p> <ul> <li>to remove the embedded manifest file from the generated application (in the project properties) : useless.</li> <li><p>to force the use of the Windows Classic theme in the application resources :</p> <pre><code>&lt;ResourceDictionary.MergedDictionaries&gt; &lt;ResourceDictionary Source="/PresentationFramework.Classic;V3.0.0.0;31bf3856ad364e35;component/themes/classic.xaml" /&gt; &lt;/ResourceDictionary.MergedDictionaries&gt; </code></pre></li> </ul> <p>This last attempt worked great for all controls, except the tab control which still displays as above.</p> <p>Any idea ?</p> <p><strong>Update</strong> : I am suspecting this behaviour is due to the custom style I have to apply to the tab control :</p> <pre><code>&lt;Window.Resources&gt; &lt;Style x:Key="Custom"&gt; &lt;Setter Property="Control.Background" Value="#FF47C7C8" /&gt; &lt;Setter Property="Control.Foreground" Value="White" /&gt; &lt;/Style&gt; &lt;Style TargetType="TabControl" BasedOn="{StaticResource Custom}" /&gt; &lt;/Window.Resources&gt; </code></pre> <p>So how can I get the classic theme with custom colors ?</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.
    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