Koordinaten des Mauscursors innerhalb eines Fensters ermitteln

void __fastcall TForm1::FormClick(TObject *Sender)
{
    TPoint P = Mouse->CursorPos;
    P = Form1->ScreenToClient(P);
    Label1->Caption = "x: "+IntToStr(P.x);
    Label2->Caption = "y: "+IntToStr(P.y);
}

Schreibe einen Kommentar