В *.h добавь переменную TPoint MousePoint;
Код | void __fastcall TForm1::FormMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { GetCursorPos(&MousePoint); SetCapture(Handle); } //---------------------------------------------------------------------------
void __fastcall TForm1::FormMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { ReleaseCapture(); } //--------------------------------------------------------------------------- void __fastcall TForm1::FormMouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { if(Shift.Contains(ssLeft)) { TPoint point; GetCursorPos(&point); Left = Left + point.x - MousePoint.x; Top = Top + point.y - MousePoint.y; MousePoint = point; } } //---------------------------------------------------------------------------
|
|