Hello everyone, I am trying to resize the form / window for which the BorderStyle value is set to bsNone, On right panel the resize is working as expected, but on left side / panel, the resize does not works as expected, the window flickers on resize and the resize operation is not smooth. Kindly help me to fix this.
I have attached the zip file with code and project settings, however, I am also reproducing the code for left & right panel resize:
procedure TForm1.LeftPanelResize(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
NewWidth: Integer;
begin
NewWidth := (Left+Width) - Mouse.CursorPos.X + RightPanel.Width;
if (NewWidth > 60) then
begin
Left := Left + Width - NewWidth;
Width := NewWidth;
end;
end;
procedure TForm1.RightPanelResize(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
NewWidth: Integer;
begin
if DoResize and (ssLeft in Shift) then
begin
SetBounds(Left, Top, Width + X - DownX, Height);
//DownX := X;
end;
end;
Thanks in advance for you help.