views:

212

answers:

3

Hey Guys, I've searched around for this question but couldn't come up with anything.

The Problem:

If a user changes the Color Scheme on their Windows Desktop, it tweaks some functionality in my .net application.

Is there any way for me to FORCE my application to use the Windows Classic Theme, regardless of what the user's theme has been set as?

Thanks!

A: 

I have done that using DevExpress (http://devexpress.com) controls, they have their own theming engine, and one of the included themes is the Windows Classic one. The themes even style the window borders, so it is a true complete look and feel control.

As to how to do it natively without a third party control, I do not know.

Specifically, look here for the theming engine in the DevExpress control suite: http://devexpress.com/Products/NET/Controls/WinForms/Skins/

gmagana
A: 

At startup set this property on the application object.

Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState.NoneEnabled;
rerun
Tried, but didn't seem to work... thanks though
monO
Also you have to comment out the enablevisualstyles method
rerun
+1  A: 

If you are using Visual Studio: when you go to your application project's properties, you will find a checkbox Enable XP Visual Styles. If you disable that, no theming should be applied to your application. I assume this is equivalent to uncommenting the line of code that user nobugz mentioned.

stakx
Yeah I tried that earlier, but its the Color Scheme (right click desktop -> Properties -> Appearance - > Color Scheme. The color scheme changes the widths of scrollbars in the application which (unfortunately) effects some thingsI'd like to force Windows Standard (instead of Slate etc...)
monO
Then an alternative would be to figure out the (default) width or height of scrollbars (you can retrieve it via a property somewhere in .NET: `SystemInformation.VerticalScrollBarWidth`, or `SystemInformation.HorizontalScrollBarHeight` respectively). You could use that info to scale your UI elements appropriately.
stakx
I ended up going the route in your comment and it seems to work; thanks for your help!
monO