子类:TGraphicControl
如何在TGraphicControl Create的时候创建一个父类TWinControl来包容自己?这个代码如何写?TXGraphic=class(TGraphicControl)
......................
TXGraphicBox=class(WinControl)
......................
constructor TGraphic.Create(AOwner: TComponent);
begin
??????????????
inherited Create(AOwner);
??????????????
end;在此先谢过!
如何在TGraphicControl Create的时候创建一个父类TWinControl来包容自己?这个代码如何写?TXGraphic=class(TGraphicControl)
......................
TXGraphicBox=class(WinControl)
......................
constructor TGraphic.Create(AOwner: TComponent);
begin
??????????????
inherited Create(AOwner);
??????????????
end;在此先谢过!
解决方案 »
- 如何在修改更新删除sql表数据时,自动记录当前批变动数据相应的操作员字段
- 如何分离listbox1中的信息,读取st.dat内的信息
- 自己的代码如何改,才能将Image显示的图像以JPG格式和Image的显示的大小写入数据库
- ??关于TADOQuery读写Oracle中Blob大数据的问题
- 在哪可以下載txDBGrid控件,我在網上找了,可人家說的那些網址都打不開
- 有关于FastReport的一个问题?
- 请问一下,如何打印DBGrid中所有的数据记录?
- 关于stringgrid的数据导入memo中
- 关于登陆问题,急用在线等,
- 高手在哪里?-----在线!
- 程序打包问题
- 动态在dbchart添加Series的问题。
不过,非要这样的话,也不是不行吧??我没有试,给出个思路你试试吧
TXGraphic=class(TGraphicControl)
......................
TXGraphicBox=class(WinControl)
......................
constructor TXGraphic.Create(AOwner: TComponent);
begin
??????????????
inherited Create(AOwner);
TXGraphicBox.Create(Self);
TXGraphicBox.Parent:= XXX;
Self.Parent:= TXGraphicbox;
??????????????
end;
begin
inherited Create(AOwner);
TXGraphicBox.Create(AOwner);
TXGraphicBox.Parent:= AOwner;
Self.Parent:= TXGraphicbox;
end;
constructor TXGraphic.Create(AOwner: TComponent);
begin
TXGraphicBox.Create(AOwner);
TXGraphicBox.Parent:=TForm(AOwner);
inherited Create(AOwner);
Self.Parent:= TXGraphicbox;
end;显示出来的两个控件分开独立,没有成功。
var
XGraphicbox : TXGraphicbox;
begin
XGraphicbox := TXGraphicBox.Create(AOwner);
XGraphicBox.Parent:=TForm(AOwner);
inherited Create(AOwner);
Self.Parent:= XGraphicbox;
end;
constructor TXGraphic.Create(AOwner: TComponent);
begin
TXGraphicBox.Create(AOwner);
TXGraphicBox.Parent:=TForm(AOwner);
inherited Create(AOwner);
Self.Parent:= TXGraphicbox;
end;
前面没有成功是因为创建TXGraphic的时候给为它指定父类为TForm.取消外部指定父类该为内部指定父类就成功了。纯属操作失误:)谢谢两位!