Skip to main content
.NET 8.0+

High DPI Support in a Windows Forms Application

  • 2 minutes to read

Before you run an XAF Windows Forms application in a high-DPI environment, ensure that the application is DPI-aware.

To ensure that an application has proper high DPI support, the Solution Wizard adds the following application settings section to the YourApplicationName.Win\App.config file every time you create a new project:

<applicationSettings>
  <DevExpress.LookAndFeel.Design.AppSettings>
    <setting name="DPIAwarenessMode" serializeAs="String">
      <value>System</value>
    </setting>
  </DevExpress.LookAndFeel.Design.AppSettings>
</applicationSettings>

To enable DPI-Aware mode manually, use one of the techniques described in the following topic: High DPI Support.

Report Wizard

When you add the Reports V2 Module to a new application project in the Solution Wizard, the module already includes the Report Wizard optimized for high-DPI screens.

To enable optimization for high-DPI screens for the Report Wizard manually, open the WinApplication.cs (WinApplication.vb) file. In a WinApplication descendant constructor, set the static WinReportServiceController.UseNewWizard property to true.

DevExpress.ExpressApp.ReportsV2.Win.WinReportServiceController.UseNewWizard = true;

SVG Images

All applications created with the Solution Wizard support SVG images.

To enable support for SVG images manually, go to the Program.cs (Program.vb) file. In the Main method call, set the UseSvgImages property to true.

Current Limitations and Recommendations

  • Design your applications under 96 DPI (100%). When you downscale a form developed in a high-DPI environment, issues may occur.
  • XAF does not support Per-Monitor DPI. When you drag an application window between monitors with different DPI settings, the operating system uses its built-in mechanisms to scale the window accordingly.
See Also