我在一个image外面画了个Shape矩形框,为image添加了鼠标事件
我单独建个工程测试,功能一切正常。
但是我引入我的相对大一点的程序后就不正常了,矩形shape框里的image接收不到鼠标事件了
不创建Shape的话就能接收到鼠标事件,看来问题就是shape了
为什么单独一个小工程里一切正常,换个地方就不正常了呢这个shape是这样用的
   MyRectangle := TShape.Create(self) ;
   MyRectangle.Shape := stRectangle;
   MyRectangle.Visible := false; //下面再变为True
   MyRectangle.Brush.Style := bsClear;
   MyRectangle.Pen.Style := psDot;
   MyRectangle.Pen.Color := clRed;
   MyRectangle.Pen.Width := 3;   with MyRectangle do
begin
   Parent := self;
   Top := MyImg.Top - 2;
   Height := MyImg.Height + 4;
   Left := MyImg.Left - 2;
   Width := MyImg.Width + 4;
   Visible := true;
  end;代码和测试都没什么问题,但是放在另一个程序里,只要image外有Shape框鼠标事件就接不到了
有什么办法可以让image接收鼠标事件吗?