UNKNOWN !************************************** ! for :Moving Form !************************************** Freeware !************************************** ! Name: Moving Form ! Description:You can move the form by holding the left mouse button and moving the Mouse. Useful if the borderstyle is bsnone. ! By: Christoph Rosemann ! ! ! Inputs:none ! ! Returns:none ! !Assumes:The procedures needs the global variables xdif,ydif:integer;status:boolean ! !Side Effects:none !This code is copyrighted and has limited warranties. !Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.483/lngWId.7/qx/vb/scripts/ShowCode.htm !for details. !************************************** var Form1: TForm1; status:boolean; //s need to be global xdif,ydif:integer; /need to be global implementation {$R *.DFM} procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if status = false then exit; form1.left := mouse.cursorpos.x -xdif; form1.top := mouse.cursorpos.y -ydif; end; procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin xdif := mouse.cursorpos.x - form1.left; ydif := mouse.cursorpos.y - form1.top; status := true; end; procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin status := false; end;