本文共 703 字,大约阅读时间需要 2 分钟。
参考:
之前用RDLC做报表无论怎么设置,打印预览的时候总是只占A4纸左上角,找了好久才终于找到了原因,竟然是因为系统设置了字体放大150% 。。。深深无语中
无意中在这个论坛中找到了类似现象,试了下代码,能解决问题!!!
[STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } BonusSkins.Register(); SkinManager.EnableFormSkins(); UserLookAndFeel.Default.SetSkinStyle("DevExpress Style"); Application.Run(new Form1()); } [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern bool SetProcessDPIAware();
转载地址:http://dhikf.baihongyu.com/