J
jhddx
Unregistered / Unconfirmed
GUEST, unregistred user!
我想开发一个image和一个label组合在一起的控件,因为我想他们两处在同一个基板上,以基板为父级容器,所以继承了TWinControl,主要代码如下:Type Panelview = class(TWinControl); pravite Fimage: Timage; Flabel: Tlabel; Fpicture: Tpictuer; Fcaption: Tcaption; procedure FSetpicture(Const value: Tpicture); ...Publishedproperty picture: Tpicture read Fpicture write FSetpicture;property caption: Tcaption read Fcaption write FSetcaption; Constructor TPanelview.Create(AOWner: TComponent);begin inherited; width := 265; height := 160; Fpicture := Tpicture.Create; Fimage := Timage.Create(self); Fimage.Parent := Self; Fimage.Top := 5; Fimage.Left := 5; Fimage.Width := 150; Fimage.Height := 150; Flabel:= Tlabel.create(self); Flabel.parent := Self; Flabel.Top := 5; Flabel.Left := 160; Flabel.Width := 100; Flabel.Height := 30; Flabel.Caption := '标题区域';end;procedure TPanelview.FSetpicture(Const value: Tpicture);begin Fimage.Picture.Assign(value);end;procedure TPanelview.FSetcaption(value: Tcaption);begin Flabel.Caption := value;end;end.以上控件安装后,label显示正常,image在设计时能显示,运行时就看不到了,请问下知道的朋友,这是什么问题,应该如何解决! 如果有能解决,可加分答谢!