Einzelnen Beitrag anzeigen

Benutzerbild von sh17
sh17

Registriert seit: 26. Okt 2005
Ort: Radebeul
1.643 Beiträge
 
Delphi 11 Alexandria
 
#8

Re: Unterkategorien bei Komponenten

  Alt 25. Nov 2005, 10:18
Vielleicht so
Delphi-Quellcode:
TAnything = class(TPersistent)
        private
          FInt1, FInt2: integer;
          FStr: string;
        public
          procedure Assign(Source: TPersistent); override;
        published
          property Int1: integer read FInt1 write FInt1;
          property Int2: integer read FInt2 write FInt2;
          property Str: string read FStr write FStr;
      end;

procedure TAnything.Assign(Source: TPersistent);
begin
  if Source is TAnything then
  begin
      TAnything(Source).Int1 := Int1;
      TAnything(Source).Int2 := Int2;
      TAnything(Source).Str := Str;
    Exit;
  end;
  inherited Assign(Source);
end;
Sven Harazim
--
  Mit Zitat antworten Zitat