Strange behavior of the TForm.Left property lazarus / 31-LCL ---------------------------------------------------------------------- Unvictis · 2025-06-10 09:24 Hello! Why is it that when I specify the Left = 0 position in the properties for the TForm shape, the shape has an indentation significantly greater than zero pixels (about 7 pixels). At the same time, for Top = 0, everything works as intended. Windows 10 22H2 x64, Lazarus 2.0.8 x86, Lazarus 4.0 x86 ---------------------------------------------------------------------- VisualLab · 2025-06-10 09:51 I confirm, this is indeed the case. I am using: Windows 10 64-bit, Lazarus 3.8 64-bit. ---------------------------------------------------------------------- Unvictis · 2025-06-10 12:33 To check, I made additional applications on Delphi 2, 4, 7 and ran them on Windows 95, XP, 7, 10. This bug appears only under Windows 10, regardless of the Delphi/Lazarus version. I think this is a problem (feature) of Windows 10. ---------------------------------------------------------------------- Zvoni · 2025-06-10 12:35 Maximize your Form and read out the Left-Property. Does it return "0" or a negative value? ---------------------------------------------------------------------- n7800 · 2025-06-10 12:40 I checked on Windows 7 and 8.1, and everything is fine. But I think it's not the version, but the theme. I have them disabled (for performance), but on your screenshot there is a half-shadow around the window. Maybe it is taken into account? You can try to disable them in the OS settings, if you don't mind rebooting your PC. But you can check how it works at run-time. Try to run the application with this event: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormCreate(Sender: TObject);begin  Left := 0;end;  is it displayed at the edge? Now try to disable "Use manifest resource (and enable themes)" in the project options (see the attached screenshot) and run it again. ---------------------------------------------------------------------- Unvictis · 2025-06-10 12:52 Quote from: Zvoni on June 10, 2025, 02:35:55 pmMaximize your Form and read out the Left-Property. Does it return "0" or a negative value? When i maximize form Left value is -8. ---------------------------------------------------------------------- Martin_fr · 2025-06-10 13:12 https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/33865 ---------------------------------------------------------------------- Zvoni · 2025-06-10 13:53 What i could find out, it has apparently to do with BorderStyle in combination with Win10-Themes n7800 idea to disable "Use manifest resource (and enable themes)" in Project-Options makes no difference And Martin pretty much confirms it with the Link to the GitLab-Issue ---------------------------------------------------------------------- Unvictis · 2025-06-10 15:35 Thank you, friends, for your quick response and for your lively participation in my question! Based on the above, I came to the conclusion that this error is not in the Lazarus LCL / Delphi VCL code, but rather in the incorrectly displayed actual Windows 10 windows (https://superuser.com/questions/1098708/is-it-possible-to-turn- visible-the-invisible-windows-borders-of-windows-10). Now I'm thinking about methods to compensate for this distance when calculating the position of the form (after checking the type and version of the system), for example: Form1.Left := 0 - deltaX , where deltaX is the system width of the window border. The question arises, how to get it correctly? Via GetSystemMetrics from WinAPI? In this case, which constant should I use correctly (SM_CXSIZEFRAME, SM_CXFOCUSBORDER, SM_CXFRAME or another)? ---------------------------------------------------------------------- n7800 · 2025-06-10 18:26 I've been trying to find a Microsoft article where I read a long time ago about this (shadow, client area, rounded corners and other window effects), but I couldn't find it. But in the process of searching I came across some answers to your question: https://stackoverflow.com/questions/32159675/retrieve-window-size- without-windows-shadows ---------------------------------------------------------------------- Thaddy · 2025-06-11 04:19 You were probably searching for an article by Raymond Chen? ---------------------------------------------------------------------- Unvictis · 2025-06-11 04:53 Thank you all for trying to figure out my question. The topic probably goes beyond the Lazarus forum, so I'll try to look for answers in the WinAPI documentation. The topic can be closed. ---------------------------------------------------------------------- Unvictis · 2025-06-11 06:31 Quote from: Thaddy on June 11, 2025, 06:19:15 amYou were probably searching for an article by Raymond Chen? I found this article: https://devblogs.microsoft.com/oldnewthing/20150304-00/?p=44543 ---------------------------------------------------------------------- n7800 · 2025-06-11 08:38 Quote from: Unvictis on June 11, 2025, 08:31:28 amQuote from: Thaddy on June 11, 2025, 06:19:15 amYou were probably searching for an article by Raymond Chen? I found this article: https://devblogs.microsoft.com/oldnewthing/20150304-00/?p=44543 Unfortunately, no. If I remember correctly, it was a fairly large page from the documentation (MSDN), not just an article. ---------------------------------------------------------------------- n7800 · 2025-06-11 08:50 There was something like these pages (just an example): * https://learn.microsoft.com/en-us/windows/apps/design/layout/depth- shadow * https://learn.microsoft.com/en-us/windows/win32/dwm/customframe but it was written in detail about borders/shadows and a WinAPI function for working with them. ---------------------------------------------------------------------- jamie · 2025-06-11 13:13 Get/set windowrect(....)