获取控件的xy坐标

Posted zyb2016

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取控件的xy坐标相关的知识,希望对你有一定的参考价值。

procedure TForm1.SpeedButton1Click(Sender: TObject);
var
  Apoint:TPoint;
begin
  APoint:=TSpeedButton(Sender).ClientToScreen(Point(0,TSpeedButton(Sender).ClientHeight));
  PopupMenu1.Popup(Apoint.X,Apoint.Y);
end;

以上是关于获取控件的xy坐标的主要内容,如果未能解决你的问题,请参考以下文章