Thread: Moving Form
View Single Post
Old Nov 14th, 2005, 4:34 PM   #7
-=PARADOX=-
Programmer
 
-=PARADOX=-'s Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 3 -=PARADOX=- is on a distinguished road
This is how my code looks right now:

void __fastcall TForm1::BackgroundMouseMove(TObject *Sender,
      TShiftState Shift, int X, int Y)
{
        if ( Shift.Contains(ssLeft) ) // this tests if we are pressing the left button of the mouse
       {   
               Form1->Left = Mouse->CursorPos.x;
               Form1->Top = Mouse->CursorPos.y;
        }
}

This works... but not very well...
How do I calculate the distance travelled?

Thanks
-=PARADOX=- is offline   Reply With Quote