Oscar Hernández 0 Posted yesterday at 07:02 PM (edited) Hello everyone, I am upgrading my projects from Delphi 10.4 to Delphi 12, and I have noticed that all my forms with BorderStyle set to bsDialog have increased in width and height by 10 pixels. The problem is that some of these forms are configured at runtime using the Width and Height properties, so in Delphi 12, they appear smaller than expected. Is there a way to prevent this, or any workaround to handle the issue? Below are some screenshots of a form in Delphi 10.4 with BorderStyle set to bsDialog, compared to the same form opened in Delphi 12. Edited yesterday at 07:05 PM by Oscar Hernández Share this post Link to post
pyscripter 730 Posted yesterday at 07:49 PM (edited) Are you using Vcl? Are you using styles? I can see that in your images the form title bars are styled differently. I don't see that in a simple dialog: Delphi 11: Client width 269, Width 285 Delphi 12: Same. Edited yesterday at 07:50 PM by pyscripter Share this post Link to post
Oscar Hernández 0 Posted yesterday at 08:13 PM (edited) No, I am not using VCL Styles, the left side is from RAD Studio 10.4 (Sydney) and the right side is from RAD Studio 12.1 (Athens) This is a VCL Project. I have noticed that Delphi 12 styles the title bar different from Delphi 10.4 Also if the BorderStyle of the form is set to bsSizeable, the size of Client Width and Width are equals on the two IDEs but it changes when the BorderStyle is set to bsDialog. Form1 with BorderStyle set to bsDialog Delphi 10.4 (Left side) <-> Delphi 12 (Right side) Form1 with BorderStyel set to bsSizeable Delphi 10.4 (Left side) <-> Delphi 12 (Right side) Can you notice the difference? Edited yesterday at 08:14 PM by Oscar Hernández Share this post Link to post
pyscripter 730 Posted yesterday at 09:59 PM Yes I do notice the difference. However I do not have 10.4 installed to compere. Delphi 12 behaves the same as Delphi 11 though. Share this post Link to post
Anders Melander 1938 Posted yesterday at 10:12 PM The manifest of Delphi 10 and 11+ are probably different so Delphi 10 gets the XP window style, while 11+ gets the current window style. I don't have Delphi 10 installed anymore but if you can post its manifest then we can verify. Apart from that, if you rely on Form.Width/Height this will not only be a problem in the IDE but also at run-time where your application will use whatever windows style the host OS dictate. Use Form.ClientWidth/ClientHeight instead; Then you don't have to worry about the border width. 1 Share this post Link to post
Oscar Hernández 0 Posted yesterday at 10:25 PM On 3/14/2025 at 9:59 PM, pyscripter said: Yes I do notice the difference. However I do not have 10.4 installed to compere. Delphi 12 behaves the same as Delphi 11 though. Yes, it seems that Delphi 10.4 and Delphi 11+ behave differently in this aspect. Thank you for your responses. Share this post Link to post
Oscar Hernández 0 Posted 23 hours ago On 3/14/2025 at 10:12 PM, Anders Melander said: The manifest of Delphi 10 and 11+ are probably different so Delphi 10 gets the XP window style, while 11+ gets the current window style. I don't have Delphi 10 installed anymore but if you can post its manifest then we can verify. Apart from that, if you rely on Form.Width/Height this will not only be a problem in the IDE but also at run-time where your application will use whatever windows style the host OS dictate. Use Form.ClientWidth/ClientHeight instead; Then you don't have to worry about the border width. Yes, I think that we are going to change that and rely on ClientWidth/ClientHeight instead of Widht/Height. Here is the Manifest: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> <asmv3:application> <asmv3:windowsSettings> <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> </asmv3:windowsSettings> </asmv3:application> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/> </dependentAssembly> </dependency> </assembly> Share this post Link to post
Anders Melander 1938 Posted 23 hours ago 23 hours ago, Oscar Hernández said: Yes, I think that we are going to change that and rely on ClientWidth/ClientHeight instead of Widht/Height. If you look at the IDE form designer, you can see that that is also what it does; The client size stays the same between the two Delphi versions. 23 hours ago, Oscar Hernández said: Here is the Manifest: Yes; It's missing the whole <compatibility> section so it basically gets the Windows XP treatment. 1 Share this post Link to post