这个问题我前一段时间刚刚问过这个问题,当时解决办法如下:
----------------------------------------------------------------------------
constructor TRJ.Create(AOwner:TComponent);
begin
inherited Create(AOwner);
...
//´´½¨×ӿؼþ£¨ÈçImage£©
ImageShow:=TImage.Create(self);
...
ImageShow.OnMouseMove := ImageOnMouseMove;
...
end;
procedure TRJ.ImageOnMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
MouseMove(Shift, ImageShow.Left + X, ImageShow.Top + y);
end;
-------------------------------------------------------------------------
TRJ是自定义的组合控件,包含一个子控件ImageShow(TImage),这样有多个子控件的时候就得
为每个子控件在构造函数中添加这一句:
子控件.OnMouseMove := ImageOnMouseMove;