Bad layout lazarus / 67-Windows ---------------------------------------------------------------------- LemonParty · 2025-06-26 13:10 I have a small windowed app. On the form of this app present TPanel, TImage and TLabel. In Windows 10 this app looks fine. In Windows 11 elements are not on their places and have smaller size. Is MS break something? ---------------------------------------------------------------------- alpine · 2025-06-26 13:15 Is it the screen in the same DPI? ---------------------------------------------------------------------- LemonParty · 2025-06-26 13:23 No. ---------------------------------------------------------------------- alpine · 2025-06-26 13:28 Then look at https://wiki.freepascal.org/High_DPI ---------------------------------------------------------------------- LemonParty · 2025-06-26 13:47 I found this QuoteIf you create controls run-time, scale all coordinates, sizes etc that have to be DPI-aware with TControl.Scale96ToForm() or ScaleDesignToForm() (depending on your choice of default PPI) or prepare your container (e.g. panel with controls) as it was with 96 PPI and then call TControl.AutoAdjustLayout(lapAutoAdjustForDPI, 96, ParentFormOfTheContainer.PixelsPerInch, 0, 0);I create controls in runtime and have high DPI. What method should I call? (DPI awareness is set to "on") ---------------------------------------------------------------------- alpine · 2025-06-26 14:15 Quote from: LemonParty on June 26, 2025, 03:47:40 pmI found this QuoteIf you create controls run-time, scale all coordinates, sizes etc that have to be DPI-aware with TControl.Scale96ToForm() or ScaleDesignToForm() (depending on your choice of default PPI) or prepare your container (e.g. panel with controls) as it was with 96 PPI and then call TControl.AutoAdjustLayout(lapAutoAdjustForDPI, 96, ParentFormOfTheContainer.PixelsPerInch, 0, 0);I create controls in runtime and have high DPI. What method should I call? (DPI awareness is set to "on") I'm not quite sure but I would suggest to make use of anchoring and child-sizing mechanisms instead of trying to recalculate fixed positions. https://wiki.freepascal.org/LCL_AutoSizing https://wiki.freepascal.org/Anchor_Sides ---------------------------------------------------------------------- wp · 2025-06-26 17:37 Just made myself a VM with Windows 10 as guest in my standard Windows 11. And I don't see any layout issue for a project migrating between both systems, even with non-anchored and non-autosized controls, and independent of monitor resolution. You say that "dpi awareness" is "on". But is LCL scaling on as well? (it should be by default). Note that these two settings are relevant for pixel density changes (ppi). But there is another setting in Windows which allows to change text size only, under Settings > Accessibility settings. The case when TextSize here is different from 100% is not handled by LCL scaling, only the text becomes larger and, if controls are not anchored and autosized, they tend to overlap their neighbors - see attached screenshots comparing 100% and 150% text size settings. Do not use this setting to increase text size, use only the setting in System > Screen > Scaling ---------------------------------------------------------------------- LemonParty · 2025-06-27 12:06 Thank you, alpine. QuoteBut there is another setting in Windows which allows to change text size only, under Settings > Accessibility settings.Yes, I used this setting. Seems that what case the problem.