简体   繁体   English

c#.net4 VisualStyles是否可以使窗体控件看起来像在XP下的Vista / win7上一样?

[英]c# .net4 VisualStyles is there a way to make a forms controls to look as they do on Vista/win7 under XP?

Hi I have a form that uses checkbox with the appearance set to button and it works well and looks good on Win7 but on XP it doesn't, you cannot tell if they are up or down... 嗨,我有一个使用复选框将外观设置为按钮的表单,它在Windows 7上运行良好且看起来不错,但在XP上却不行,您无法确定它们是向上还是向下...

so can I make the form look as it does on W7 regardless of which OS its running on? 因此,无论运行在哪个OS上,我都可以使窗体看起来像W7一样吗?

I have tried this.EnableVisualStyles = true; 我已经尝试过this.EnableVisualStyles = true; and setting it to false makes the form look crap in Win 7... 并将其设置为false会使窗体在Win 7中看起来像废话...

cheers 干杯

This is not possible. 这是不可能的。 EnableVisualStyle only enables the OS-specific rendering (that is, non "classic" rendering). EnableVisualStyle仅启用特定于OS的呈现(即非“经典”呈现)。 The buttons are always rendered OS-specific. 这些按钮始终是特定于OS的。

If you want OS-independent rendering, you have to use a control libary like Infragistics or Nevron. 如果要独立于OS渲染,则必须使用Infragistics或Nevron之类的控件库。 But I don't think this is a good idea anyway. 但是我仍然认为这不是一个好主意。 Your application should look like it is integrated in the os theme in my opinion. 我认为您的应用程序应该看起来已集成到os主题中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM