jsen262 0 Posted May 11, 2023 (edited) Hi, I've an old application developed in delphi 7 , having some issue about showin forms when I ran on win 10 there's nothing wrong, seems normal. but when I ran on win 11 the form become oversize. Can somebody help me, how to ajust this in win 11 without change the project's source code. Both of them... I ran it in 1920 * 1080 resolution Thanks in advanced.... Edited May 11, 2023 by jsen262 the picture Share this post Link to post
David Heffernan 2345 Posted May 11, 2023 2 hours ago, jsen262 said: Hi, I've an old application developed in delphi 7 , having some issue about showin forms when I ran on win 10 there's nothing wrong, seems normal. but when I ran on win 11 the form become oversize. Can somebody help me, how to ajust this in win 11 without change the project's source code. Both of them... I ran it in 1920 * 1080 resolution Thanks in advanced.... Hard to know why this is happening with the information we have. Share this post Link to post
programmerdelphi2k 237 Posted May 11, 2023 (edited) 2 hours ago, jsen262 said: old application developed in delphi 7 did you try right-click on executable and change the options ...(compatibility, etc...) and Snap Layout setup in Win11? note: changing scale can help in some situation... but this is used for all apps including Win11-apps note2: did you try FancyZones is a tool part of the PowerToys app that allows you to manage windows on Windows 11 and 10 https://youtu.be/ld-vmpbngDE Edited May 11, 2023 by programmerdelphi2k Share this post Link to post
jsen262 0 Posted May 11, 2023 thanks @programmerdelphi2k for your insight, both of them has been set 100% on scale in windows display setting. I'll try the powertoys, hopefully can solve this issue. Thanks.... I'll share the result Share this post Link to post
jsen262 0 Posted May 11, 2023 2 hours ago, jsen262 said: thanks @programmerdelphi2k for your insight, both of them has been set 100% on scale in windows display setting. I'll try the powertoys, hopefully can solve this issue. Thanks.... I'll share the result Sorry @programmerdelphi2k I've installed powertoys, but I can't find any setting to solve my problem If I have to change the source, what part/component should I change ? is tPanel component not suite for win 11 ? Thanks Share this post Link to post
rvk 33 Posted May 11, 2023 4 hours ago, jsen262 said: both of them has been set 100% on scale in windows display setting. That would be my first suggestion too... different dpi settings. Weird that's not the case here. Looking at the screenshots there is really something going on with different font/dpi settings. Do you include a manifest.txt in your program/resources? Is this a designed form (not created at runtime)? And is it designed on 100% 96dpi (pixelsperinch)? Is your developing machine Windows 10? With Delphi 7? Scaled etc. shouldn't matter if both are on 100% 96 dpi. In that case Delphi 7 also shouldn't matter because it doesn't do anything if it's just at 100%. Try to make a small test program with just some tlabels and tpanels and see if you that also goes wrong. Share this post Link to post
David Heffernan 2345 Posted May 11, 2023 Instead of us guessing, it would be more productive for you to boil this down to the simplest example that reproduces the issue. Share this post Link to post
Fr0sT.Brutal 900 Posted May 11, 2023 According to old-fashioned controls, "XP styles" are not enabled and manifest is likely absent Share this post Link to post
jsen262 0 Posted May 11, 2023 @rvk yes, the font become smaller (pls see red box in attached pict ) >> Do you include a manifest.txt in your program/resources? No, I dont use a manifest >> Is this a designed form (not created at runtime)? And is it designed on 100% 96dpi (pixelsperinch)? this is run time pict, >> Is your developing machine Windows 10? With Delphi 7? yes , delphi 7 on win 10 as I said before, if I ran the .exe on win xp to win 10 22H2 is normal, not either font size changing or form shrinking. Please if any other suggestion, I'll try.... Thanks Share this post Link to post
rvk 33 Posted May 11, 2023 You can also check the default system font size in Windows (do not choose Large letters etc.). But you can begin by setting a default static font and size at startup in Delphi. Otherwise a system font is taken at startup which can be different on every system. And some components get resized according to the fontsize). Application.DefaultFont See https://www.delphipower.xyz/handbook_2009/default_fonts_for_application_and_screen_global_objects.html But it's much easier to do this in a small test program than doing this in your final program. Share this post Link to post
Arnaud Bouchez 407 Posted May 11, 2023 (edited) --- Edited May 11, 2023 by Arnaud Bouchez Share this post Link to post
Fr0sT.Brutal 900 Posted May 11, 2023 5 hours ago, rvk said: Application.DefaultFont Nice property, I wasn't aware of it. But it's D2009+ Share this post Link to post
rvk 33 Posted May 11, 2023 31 minutes ago, Fr0sT.Brutal said: Nice property, I wasn't aware of it. But it's D2009+ Yes. What font does Delphi 7 use. Always the font in which it is designed (font property of the form)? In that case... what font did you set in the form property? If that font isn't available anymore in Windows 11, this could also explain a lot. So specify a font which still exists on W11 or install the font used in D7. Share this post Link to post
Brian Evans 105 Posted May 11, 2023 Windows 11 did change the default font to Segoe UI variable which is supposed to scale better on High-DPI displays than Segoe UI (Vista onward). It changes how some characters look including how tall they are which could lead to some UI issues. Share this post Link to post
Fr0sT.Brutal 900 Posted May 12, 2023 (edited) 14 hours ago, rvk said: In that case... what font did you set in the form property? If that font isn't available anymore in Windows 11, this could also explain a lot. Fair point! Probably D7 default MS Sans (IIRC) was removed from W11 Edited May 12, 2023 by Fr0sT.Brutal Share this post Link to post
David Heffernan 2345 Posted May 12, 2023 36 minutes ago, Fr0sT.Brutal said: Probably D7 default MS Sans (IIRC) was removed from W11 Nope, still there, why would MS remove it Share this post Link to post
rvk 33 Posted May 12, 2023 (edited) It might not be the default font MS Sans which is used. Or there is some font substitution going on. If you look at the image, you definitely see the fonts are different. Edited May 12, 2023 by rvk Share this post Link to post
jsen262 0 Posted June 12, 2023 sorry @rvk, I was bussy lately... I always use default font as you can see below using MS Sans Serif for applications running on Windows 11... also use the same source Share this post Link to post
rvk 33 Posted June 12, 2023 Maybe its the default font but it definitely displayed differently (look at the capitol G which is different). So maybe there is still some font substitution going on. You can first look in this registry entry to see if that font is substituted. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes Btw. You showed the font for a tlabel. But if the parentfont prop is true, it will take the font from the form. And it could be that for that the screen.font is used which might use the default menu font from windows. If that's the case you might want to do a Application.DefaultFont.Name := 'MS Sans Serif'; (or other font) before creating any forms in your .dpr). Share this post Link to post