我需要写一个对象,其中有两个属性,一个是富文本(字数较多,每个字都可能大小颜色等不同),一个图片。对象要存储到一个文件里去。小弟不知道怎么样属性声明才能做到我要的效果???请高手帮忙

解决方案 »

  1.   

    type 
     TChildClass = class(TParentClass)
      private
        FRichEdit: TRichEdit;
        FImage: TImage;
      protected
        procedure Notification(AComponent: TComponent; Operation: TOperation); override;
      published
        property RichEdit: TRichEdit read FRichEdit write FRichEdit;
        property Image: TImage read FImage write FImage;
      end;implementationprocedure TChildClass.Notification(AComponent: TComponent;
      Operation: TOperation);
    begin
      inherited Notification(AComponent, Operation);
      if Operation = opRemove then
      begin
        if AComponent = FRichEdit then FRichEdit := nil
        else if AComponent = FImage then FImage := nil;
      end;
    end;————————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    ————————————————————————————————————
      

  2.   

    我想知道怎么write?这些图片和文本属性要和其它属性存储到一个文件中。