AdjustClientRect lazarus / 31-LCL ---------------------------------------------------------------------- mishalazarus · 2021-04-29 07:29 I want to write TMyGroupBox=class(TCustomControl) The problem I have is Top=0 but then the button covers the title. I looked at Delphi source code and found AdjustClientRect but that doesn't affect Left,Top according to https://wiki.freepascal.org/Autosize_/_Layout#AdjustClientRect "The method AdjustClientRect can be overriden by your custom controls and affects Align, ChildSizing.Layout and AnchorSides. It does not affect the meaning of Left, Top" This seems different to Delphi I also tried GetClientRect, GetLogicalClientRect and so on but no effect. I looked at the source code of TGroupBox but it's empty. Thank you for any help here. I am writing an open source package about how to drag and drop controls at runtime: https://github.com/misha-david-strong/runtimedrop ---------------------------------------------------------------------- jamie · 2021-04-29 20:55 you need to simulate what you are doing.. use a TPANEL as your client area and the base of the control as the non client area.. Leave some gap around the panel so that you can draw your non client areas etc.. Also, if you want to simple a real non client area then process the WM_NCHITTEST message, with that you can return info to inform the OS that an area is non client so you can get the drag cursors, window sizing etc..