J jinmen Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-23 #4 button1.left button1.top 不就是吗?
L lmcui Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-23 #6 left: Form1.Left + Button1.Left; Top: Form1.Top + Button1.Top;
Z zw84611 Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-23 #7 var p: TPoint; begin p := Point(Button1.Left, Button1.Top); Windows.ClienttoScreen(handle,P); //get the position in desktop. //p.x和p.y就是了。 end;
var p: TPoint; begin p := Point(Button1.Left, Button1.Top); Windows.ClienttoScreen(handle,P); //get the position in desktop. //p.x和p.y就是了。 end;
J jsxjd Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-23 #8 如果你的按钮在 form1 上 procedure TForm1.Button2Click(Sender: TObject); var p:TPoint; begin p.x:=button1.Left; p.y:=button1.Top; p:=ClientToScreen(p); showmessage(format('x=%d y=%d',[p.x,p.y])); end; 如果你的按钮在 form的panel1上,相应语句改成: p:=panel1.ClientToScreen(p);
如果你的按钮在 form1 上 procedure TForm1.Button2Click(Sender: TObject); var p:TPoint; begin p.x:=button1.Left; p.y:=button1.Top; p:=ClientToScreen(p); showmessage(format('x=%d y=%d',[p.x,p.y])); end; 如果你的按钮在 form的panel1上,相应语句改成: p:=panel1.ClientToScreen(p);