Handle runtime change of DPI (text size) on Windows 10

前端 未结 2 677
被撕碎了的回忆
被撕碎了的回忆 2021-01-02 07:28

On Windows 10, the system no longer requires restart (logoff/logon) to change DPI (text size).

My application is not ready for such a runtime change.

How doe

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-02 07:59

    Since C++ Builder 10.3 you can use these form events:

    • OnAfterMonitorDpiChanged
    • OnBeforeMonitorDpiChanged

    Of course you also need to set DPI Awareness to PerMonitorV2 in the application manifest in the project settings.

提交回复
热议问题