我在一个Form上创建了一个ScrollBox,又在这个ScrollBox里创建了一个Panel,又在这个Panel里创建了一个Shape。
问:
取得Shape相对于ScrollBox的坐标,如何取得Shape相对于Form的坐标?
问:
取得Shape相对于ScrollBox的坐标,如何取得Shape相对于Form的坐标?
解决方案 »
- 请教 PrintDBGridEh 设置打印纸型为A4怎么设置?
- 在windows2003上已经安装了myodbc3.51,可是在delphi7中设置ADO控件的ConnectionString时在“提供程序”选项页中根本找不到myodbc驱动
- 在线等待,急急急!!!!!!!!!!!!!
- 这段程序不太理解,麻烦大家帮着解释一下
- 200分求InstallShield的注册码(急!!!!!!!1)
- sql语句问题
- 关于ADODateset 的用法
- 高分请教,如何用Delphi实现Active Documents,只要对我有帮助,都有分。
- 路见不平
- TDBgrideh在那个地方设置多行表头?
- 字符串截取!
- CORBA能够实现并行计算吗
Y: Integer);
begin
X_xy := ScrollBox1.Left + Panel1.Left + Shape1.Left + X;
Y_xy := ScrollBox1.Top + Panel1.Top + Shape1.Top + Y;
end;procedure TForm1.Shape1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ShowMessage('X:' + IntToStr(X_xy) + 'Y:' + IntToStr(Y_xy));
end;
X_xy,Y_xy: integer;//定义2个坐标的全局变量
shape.top:=scrollbox.top+Shape相对于ScrollBox的top;
不知道是不是这个意思