在FORM中放StatusBar1控件.要在StatusBar1上即时显示鼠标的所在的X,Y值,鼠表移动到哪,StatusBar1上就即时变化X,Y坐标值,请指导,谢谢.

解决方案 »

  1.   

    procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
      xx:= x;
      yy:= y;
      StatusBar1.Panels[0].Text:= inttostr(xx*yy);
    end;
      

  2.   

    procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    begin
      StatusBar1.Panels[0].Text:= inttostr(x)+'  '+inttostr(y);
    end;
      

  3.   

    在form的onmousemove事件中添加如下语句StatusBar1.Panels[0].Text:=inttostr(x)+','+inttostr(y);
      

  4.   

    GetCursorPos(pt);也可以的
    pt 是TPoint类型