我想从tcxgrid中生成一个新的组件,希望每次建立它时,缺省是生成 bandview,而不是原来的tableview,但是在 constructor create(AOwner:tcomponent);override;
begin
inherited create(aowner);
application.messagebox(pchar(inttostr(self.ViewCount)),'aaa');
end; 中,访问不了view的,这个时候,viewcount还是0,好象在这个时候还没有创建的,是怎么回事呢? 谢谢
begin
inherited create(aowner);
application.messagebox(pchar(inttostr(self.ViewCount)),'aaa');
end; 中,访问不了view的,这个时候,viewcount还是0,好象在这个时候还没有创建的,是怎么回事呢? 谢谢
这样的话,如果以后tcxgrid升级了,是不是又要重新做这步工作?用重载行不行?
type
TcxGridEx = class(TcxGrid)
protected
procedure Loaded;override;//覆盖加载组件的方法
end;implementation
procedure TcxGridEx.Loaded;
begin
inherited;
application.messagebox(pchar(inttostr(self.ViewCount)),'aaa');
end;