[SOLVED] Form scale bsNone lazarus / 31-LCL ---------------------------------------------------------------------- Pe3s · 2022-08-25 16:59 Hello forum members, I took the code from the BAGRA Ribbon demo there is a scaling of the form from the right corner, how can I modify the code so that I can scale from the left corner? 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 TfrmMain.imgResizeMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: integer);begin  PtSize.y := Mouse.CursorPos.y - Top - Height;  PtSize.x := Mouse.CursorPos.x - Left - Width;end;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 TfrmMain.imgResizeMouseMove(Sender: TObject; Shift: TShiftState;  X, Y: integer);begin  if ssLeft in shift then  begin    Width := Mouse.CursorPos.x - Left - PtSize.x;    Height := Mouse.CursorPos.y - Top - PtSize.y;  end;end; ---------------------------------------------------------------------- jamie · 2022-08-26 01:05 The first thing you do is look at this message. https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest Include the Lmessages and LCLIntf unit so that you can use the LM_NCHITTEST instead of the windows version which is btw the same define but makes it cross the river happy.   Use the SendMesssage to retrieve the results etc.  This will give you the exact location of the form where you clicked on it, in case you hit the outside the client area.  Basically this is a "Non Client Hit Test"  once you do that,  you can use other items to move your window around. good luck. ---------------------------------------------------------------------- jamie · 2022-08-26 01:40 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 unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, RTTICtrls,Lmessages,LCLintf; type   { TForm1 }   TForm1 = class(TForm)  private   public    Procedure WMHittest(var Msg:TLmNcHittest) Message LM_NCHITTEST;   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 }Procedure Tform1.WMHitTest(var Msg:TLmNCHitTest);Begin  Inherited;  Caption := Msg.Result.ToString;End;end.    Play with that and you can see the different values when you grab the edges of the screen. ---------------------------------------------------------------------- Pe3s · 2022-08-26 15:23 @jamie Thank you