Registriert seit: 19. Jul 2005
43 Beiträge
|
Re: Cursor bei onMouseDown ändern
27. Aug 2005, 18:02
Delphi-Quellcode:
const
FFormMoving: boolean = false;
var
FMoveStartPos: TPoint;
procedure TForm1.FormCreate(Sender: TObject);
begin
Panel.Cursor := crCross;
end;
procedure TForm1.PanelMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
begin
FFormMoving := True;
FMoveStartPos := Point(X, Y);
Panel.Cursor := crSizeAll;
ReleaseCapture;
Application.processmessages;
SetCapture(Panel.handle);
end;
end;
procedure TForm1.PanelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if FFormMoving then
SetBounds(Left - (FMoveStartPos.x - x), Top - (FMoveStartPos.y - y),
Width, Height);
end;
procedure TForm1.PanelMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
begin
FFormMoving := False;
Panel.Cursor := crCross;
end;
end;
Gruß DBR
|
|
Zitat
|