Windows Form Visual Style under Windows 8

2019-08-04 09:04发布

I have a windows form application, and I call Application.EnableVisualStyles() in the Main(), and under windows 7,

A button looks like this: enter image description here

But under Windows 8, the same button looks like this: enter image description here

Is there a way to make the application visual style under windows 8 look similar to what under windows 7?

Thanks in advance.

1条回答
该账号已被封号
2楼-- · 2019-08-04 09:52

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);

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.

查看更多
登录 后发表回答