Oscar Hernández 0 Posted 11 hours ago (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 11 hours ago by Oscar Hernández Share this post Link to post
pyscripter 730 Posted 10 hours ago (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 10 hours ago by pyscripter Share this post Link to post
Oscar Hernández 0 Posted 9 hours ago (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 9 hours ago by Oscar Hernández Share this post Link to post
pyscripter 730 Posted 8 hours ago 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 1937 Posted 7 hours ago 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 7 hours ago 17 minutes ago, 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 7 hours ago 7 minutes ago, 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 1937 Posted 7 hours ago Just now, 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. Just now, 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