Windows 8下的Windows Form视觉样式 [英] Windows Form Visual Style under Windows 8

查看:137
本文介绍了Windows 8下的Windows Form视觉样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆