1. 程式人生 > >C#在高分屏上讓窗體程序忽略系統的顯示縮放

C#在高分屏上讓窗體程序忽略系統的顯示縮放

bool pos nbsp render services col etc thread text

[STAThread]
    static void Main() {
        if (Environment.OSVersion.Version.Major >= 6) SetProcessDPIAware();
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());             // Edit as needed
    }

    [System.Runtime.InteropServices.DllImport(
"user32.dll")] private static extern bool SetProcessDPIAware();

C#在高分屏上讓窗體程序忽略系統的顯示縮放