Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows theme affecting ListView header
    text
    copied!<p>I've created new Windows Forms Application (C#) with one simple form containing ListView. Then I have changed the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.view.aspx" rel="nofollow noreferrer">View Property</a> to Details and increased the size of the font used in this ListView and here's the result:</p> <p>This is how it looks on Windows XP with Windows Classic theme:<br> <img src="https://i.stack.imgur.com/oIoF7.png" alt="enter image description here"></p> <p>and here's the result with Windows XP theme:<br> <img src="https://i.stack.imgur.com/vcMBV.png" alt="enter image description here"></p> <p>I can prevent the appearance of my application to be affected by Visual Styles either by removing <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.application.enablevisualstyles.aspx" rel="nofollow noreferrer"><code>Application.EnableVisualStyles()</code></a> call or by changing the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.visualstyles.visualstylestate.aspx" rel="nofollow noreferrer"><code>Application.VisualStyleState</code></a>: <img src="https://i.stack.imgur.com/9IQiC.png" alt="enter image description here"><br> Although this change makes the ListView to have the desired appearance, it also affects the appearance of other controls. I'd like my ListView to be <strong>the only control that is not affected by Visual Styles</strong>. </p> <p>I've also found similar questions that try to deal with it:<br> <a href="https://stackoverflow.com/q/544203/1168156">Can you turn off visual styles/theming for just a single windows control?</a><br> <a href="https://stackoverflow.com/q/298486/1168156">How do I disable visual styles for just one control, and not its children?</a></p> <p>Unfortunately, none of mentioned solutions works. <strong>It looks like the header itself would be made up of some controls that are affected by visual styles even when visual styles for ListView control are disabled.</strong></p> <p><strong>Any C# solution that would prevent visual styles from affecting the appearance of the ListView header would be appreciated.</strong> </p>
 

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