应该在loaded里加入初始化的东西,设置属性。仔细看看help吧。

解决方案 »

  1.   

    我的意思是,放上组件就应该是运行了构造Create事件, 放上组件运行下面这段语句出错?
    constructor TSzjPanel.Create(AOwner: TComponent);
    begin
    inherited Create(AOwner);
    SzjSgrd :=TStringGrid.Create(AOwner);
    with SzjSgrd do
    begin
    Parent :=self;
    ColCount :=7;
    DefaultRowHeight :=20;
    FixedCols :=0;
    OnDrawCell :=SzjSgrdDrawCell;
    OnKeyPress :=SzjSgrdKeyPress;
    OnTopLeftChanged :=SzjSgrdTopLeftChanged;
    end;
    end;
    运行到end后出错;
    ..Class EClassNotFound with message'Class TStringGrid not found'.
      

  2.   

    这个问题是解决,但运行的时候会出现两个控件?Why?