Search This Blog

Thursday, February 16, 2017

Enhanced High DPI support in WinForms XAF applications - YOUR FEEDBACK IS NEEDED!

UPDATED:
Refer to the More enhancements to the High DPI support in WinForms XAF applications - YOUR FEEDBACK IS NEEDED! post for the most recent improvements in this regard.
====

In this post, I will describe how to make your WinForms XAF application look much better if your Windows 7, 8 or 10 is configured to show text and other items larger (150-200% or more which is a usual setting on High DPI (4K) display devices).



The following animation demonstrates the difference between the default and DPI-Aware scaling: http://i.imgur.com/Kgv4geP.gif

This functionality is already available in the most recent XAF update (16.2.4). However, there are several High DPI related bugs that we have fixed after this release. That is why I recommend you to download this hotfix before trying High DPI: DevExpressComponents-16.2.4.17046.exe

In this hotfix, the DPI-aware scaling is already enabled in XAF demos and design-time tools.



Proceed to see how to enable it in your applications.

Enable High DPI Support in a WinForms Application

To enable the High DPI Support, add the Application Manifest file to your WinForms application project and set the dpiAware element value to true.

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
        <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
    </windowsSettings>
</application>

If you use the Reports V2 Module, edit the WinApplication.cs file. In the WinApplication descendant constructor, set the static WinReportServiceController.UseNewWizard property to true.

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

This new property specifies if the new version of the Report Wizard, with enhanced skins support and optimized for high DPI displays, is used.


Current XAF limitations and DevExpress WinForms controls specifics

  1. Currently, we do not provide built-in icons for high DPI. Existing images may look blurry or too small on your screen. However, you can provide custom icons of an appropriate size.
  2. The HTML Property Editor Module does not support high DPI.
  3. Per-Monitor DPI is not supported. The application window will be upscaled/downscaled by the system when you drag it between displays with different DPI settings.
For more information about our non-XAF specificities regarding high DPI support, be sure to check out the online documentation at WinForms Controls > Common Features > High DPI Support.

We are looking forward to hearing from you

It is likely that this feature demand depends on many factors including an application and business type, region, etc. So it would be great to learn more about your own experience to prioritize our team resources in the future.

Q1. We would greatly appreciate your leaving a comment to the blog and telling us about your own client requests with regard to 4K displays support in XAF WinForms apps and your current way of handling them (even if this is "not requested so far").

Q2. If you and your business clients already needed this feature, please describe how the provided hotfix build works for you in your real projects.

Q3. If there are any display issues with different WinForms controls in various XAF modules at runtime and even with designers in Visual Studio, report them using our https://www.devexpress.com/Support/Center/Question/Create service. Of course, you are welcome to share your suggestions and general thoughts regarding this.

2 comments:

  1. Hi,

    This does not work for me, UI is scaled badly.
    I will create a ticket with examples.

    Regards,
    Mario

    ReplyDelete
    Replies
    1. Thanks for your help, Mario. BTW, you may also be interested in seeing other tickets our users reported so far after having seen this post:
      1. https://www.devexpress.com/Support/Center/Question/Details/T483983
      2. https://www.devexpress.com/Support/Center/Question/Details/T483990

      Delete