L laohe Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-31 #1 1.如何获取鼠标点击的位置,相对Form而言? 2.我将Panel设为可移动的,如何实现移动时让它不超过form.left和form.top呢?
Z zxb200 Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-31 #2 1.mouse.CursorPos.X mouse.CursorPos.y 2.procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin releasecapture; panel1.Perform(wm_syscommand,$f012,0); end;
1.mouse.CursorPos.X mouse.CursorPos.y 2.procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin releasecapture; panel1.Perform(wm_syscommand,$f012,0); end;
P Pipi. Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-31 #3 zxb200的位置是screen的,不对。下面的p才是相对form的 var p:TPoint; p:=Form1.ScreenToClient(mouse.CursorPos);
L laohe Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-31 #6 我想在edit1.text中显示,如何将TPoint转为string
L libin06 Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-31 #8 先按PiPi.得到p, edit1.text := 'X: ' + IntToStr(p.X) + '; Y: ' + IntToStr(p.Y);