开发者

Force Windows Classic Theme for Application

开发者 https://www.devze.com 2022-12-17 09:14 出处:网络
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 .n

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 se开发者_StackOverflowt as?

Thanks!


At startup set this property on the application object.

Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState.NoneEnabled;


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.


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/

0

精彩评论

暂无评论...
验证码 换一张
取 消