Edwin Yip 154 Posted November 24, 2021 (edited) Hi all, I've just encountered an issue that's quite strange and it took me hours to figure out but still couldn't confirm where dose it come from. The situation I found is like this: Let's say we have a VCL program with DPI-aware enabled (with xml manifest correctly set, all forms have `Scaled` set to true and working), and the form inheritance is like this: TFormC inherits from TFormB which in turn inherits from TFormA, which have some buttons on some panels. I found that, when running on a computer with different system DPI, TFormA will be auto scaled for 1 time and it's correct. But TFormB will be wrongly scaled and shifted twice, while TFormC will be scaled and shifted for 3 times. All other forms, even with form inheritance, but since there is no controls on the parent forms, the auto-scaling works. I'm not sure if it's related to my Delphi version and I use XE4, I wonder anyone can confirm if the issue comes from form inheritance? Edited November 24, 2021 by Edwin Yip Share this post Link to post
Guest Posted November 25, 2021 I remember this from XE2. I had a small program that removed "ExplicitHeight/Width" IIRC from the dfm's before build. But it was a long time ago, sorry. I do not have the details. HTH. Share this post Link to post
David Heffernan 2345 Posted November 25, 2021 This has always been fine here. How can this be reproduced? Share this post Link to post
Edwin Yip 154 Posted November 25, 2021 2 hours ago, David Heffernan said: This has always been fine here. How can this be reproduced? Thanks for the info. I'm not sure (yet). I'll be back with more details... Share this post Link to post
Achim Kalwa 61 Posted November 25, 2021 19 hours ago, Edwin Yip said: Let's say we have a VCL program with DPI-aware enabled (with xml manifest correctly set, all forms have `Scaled` set to true and working), and the form inheritance is like this: TFormC inherits from TFormB which in turn inherits from TFormA, which have some buttons on some panels. [...] TFormA will be auto scaled for 1 time and it's correct. But TFormB will be wrongly scaled and shifted twice, while TFormC will be scaled and shifted for 3 times. Any special alignments of panels and buttons (Bottom, Right)? Can you provide a sample project? Share this post Link to post
Edwin Yip 154 Posted November 25, 2021 1 hour ago, Achim Kalwa said: Any special alignments of panels and buttons (Bottom, Right)? Can you provide a sample project? Yes, the bottom-most panel is alClient, on the second level are a list of row-panels with alTop, and on the third level one is alLeft and another is alClient. I'll try to get a reproducible sample later after the more important tasks are done... Thanks for your concern. Share this post Link to post
Stano 143 Posted November 25, 2021 I (not just me) have the experience that if there are several components differently aligned, then there are problems with that. Try to align the components when creating the form. It is best to create them dynamically 1 Share this post Link to post
Edwin Yip 154 Posted November 26, 2021 @Stano, great, thanks for the helpful info, I'll try that and come back here with meaningful info! Share this post Link to post