How to move form if the BorderStyle
is set to bsNONE
for border style?
in firemonkey MAC OS X
Asked
Active
Viewed 1,200 times
2

TLama
- 75,147
- 17
- 214
- 392

user1581036
- 61
- 1
- 7
2 Answers
1
Without the form header, you'll need to roll your own method for the user to move the form.
To move the form in code, you can set the form's Left and Top properties.

Ami
- 1,244
- 6
- 14
-
I want to move form such as form header method . could you write an example method – user1581036 Aug 08 '12 at 04:45
-
@user1581036, I don't think you've provided enough details to write a method. Move it how? – Marcus Adams Aug 08 '12 at 13:56
0
There is how you do it in HD FireMonkey XE4 Desktop application:
var
Form1: TForm1;
isDraging: boolean;
X0, Y0: single;
implementation
{$R *.fmx}
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
isDraging := True;
X0 := X;
Y0 := Y;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Single);
begin
if isDraging then
begin
Form1.Left := Trunc(Form1.Left + X - X0);
Form1.Top := Trunc(Form1.Top + Y - Y0);
end;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Single);
begin
isDraging := False;
end;
Tested and works on Windows 7 and Mac OS X Lion.

Edijs Kolesnikovičs
- 1,627
- 3
- 18
- 34