本菜鸟一个,看书学写组件,本人想写一个组件,即鼠标进入Timage后在Timage边缘画上Tshape,退出后Tshape消失,
现在我在消息事件中,画Tshape,总提示出错, 好像无所有者或者所有者错误什么的,刚学
delphi,真是搞不懂,请各位大侠相助。

解决方案 »

  1.   

    应该不可以:如果能绘Tshape说明Timage是一个容器控件.而它不是的
      

  2.   

    procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
        Shape1.Visible :=True;
    end;procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
        Shape1.Visible :=False;
    end;