Windows Form Visual Style under Windows 8

拈花ヽ惹草 提交于 2019-12-11 10:07:39

问题


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

A button looks like this:

But under Windows 8, the same button looks like this:

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

Thanks in advance.


回答1:


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.



来源:https://stackoverflow.com/questions/21271030/windows-form-visual-style-under-windows-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!