Autor Beitrag
Default112
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP
D6 Prof
BeitragVerfasst: Do 27.05.04 13:35 
Ich habe eine Form, auf der nur ein TImage ist. Die Titlebar is weg. Jetzt kann ich aber die Form nicht mehr verschieben. Ich müsste also das TImage anklicken und ziehen, dabei soll sich aber die Form bewegen und nicht nur das Image.

Gruss
Def


edit: Lösung

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  mx:=x;
  my:=y;
end;

procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  Form1.left := Form1.Left+(x-mx);
  Form1.Top := Form1.Top+(y-my);
end;