In VCL forms I use WM_SYSCOMMAND, but in firemonkey it is undeclared.
I test this code:
procedure TForm4.dragPanelMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
isDraging := true;
X0 := X;
Y0 := Y;
end;
procedure TForm4.dragPanelMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Single);
begin
if isDraging then
begin
Form4.Left := Trunc(Form4.Left + X - X0);
Form4.Top := Trunc(Form4.Top + Y - Y0);
end;
end;
procedure TForm4.dragPanelMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
isDraging := False;
end;
this works, but just for slow moves!!!
How can I move form in Firemonkey?
WM_SYSCOMMAND
too. It it's not defined, define it. – David HeffernanWM_SYSCOMMAND
? – sma6871WM_SYSCOMMAND = $0112
msdn.microsoft.com/en-gb/library/windows/desktop/ms646360.aspx – David HeffernanSC_DRAGMOVE
constant is that MS just forget to include it to the winuser header file (and because of this also document it). I don't think it's magical somehow. sma6871, try thecode like this
and optionally move the constants to be common. – TLama$F012
. UsingSC_DRAGMOVE
is fine. And your code is for VCL. The Q is FMX. – David Heffernan