Windows 8下的Windows Form视觉样式 [英] Windows Form Visual Style under Windows 8
问题描述
我有一个Windows窗体应用程序,我在Main()中以及Windows 7下调用Application.EnableVisualStyles().
I have a windows form application, and I call Application.EnableVisualStyles() in the Main(), and under windows 7,
一个按钮看起来像这样:
A button looks like this:
但是在Windows 8中,相同的按钮如下所示:
But under Windows 8, the same button looks like this:
有没有一种方法可以使Windows 8下的应用程序外观与Windows 7下的外观相似?
Is there a way to make the application visual style under windows 8 look similar to what under windows 7?
谢谢.
推荐答案
您可以尝试在Main()函数的开头删除对Application.EnableVisualStyles()的调用,以在整个OS版本之间获得更一致的样式./p>
You can try removing the call to Application.EnableVisualStyles() at the beginning of your Main() function, to get a more consistent style across OS versions.
[STAThread]
static void Main() {
// Application.EnableVisualStyles(); <-- comment this out
Application.SetCompatibleTextRenderingDefault(false);
注意:如果这样做,您将获得老式的Windows 2000外观-而不是Windows 7外观.但是到处都会得到相同的结果.
Note: You will get the old-school Windows 2000 look if you do this -- not the Windows 7 look. But you'll get the same everywhere.
这篇关于Windows 8下的Windows Form视觉样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!