C#在高分屏上让窗体程序忽略系统的显示缩放

时间:2023-03-09 18:08:56
C#在高分屏上让窗体程序忽略系统的显示缩放
[STAThread]
static void Main() {
if (Environment.OSVersion.Version.Major >= ) SetProcessDPIAware();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1()); // Edit as needed
} [System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();