Registriert seit: 11. Jun 2006
156 Beiträge
|
Re: .Lines in einer geerbten TRichEdit ändern
12. Jun 2006, 22:05
aber mit folgender Unit gehts auch nicht:
Delphi-Quellcode:
unit Unit2;
interface
uses
SysUtils, Classes, Controls, StdCtrls, ComCtrls, Dialogs;
type
TColoredStrings = class(TStringList)
private
{ Private-Deklarationen }
protected
{ Protected-Deklarationen }
public
function AddLines( const S: string): integer;
{ Public-Deklarationen }
published
{ Published-Deklarationen }
end;
TPRichEdit = class(TRichEdit)
private
{ Private-Deklarationen }
FMyLines: TColoredStrings;
protected
{ Protected-Deklarationen }
public
constructor Create( AOWner: TComponent);
{ Public-Deklarationen }
published
{ Published-Deklarationen }
property Lines: TColoredStrings read FMyLines write FMyLines;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents(' Beispiele', [TPRichEdit]);
end;
function TColoredStrings.AddLines( const S: string): integer;
begin
showmessage(S);
end;
constructor TPRichEdit.Create(AOWner: TComponent);
begin
inherited Create( AOwner);
FMyLines := TColoredStrings.Create;
end;
end.
|
|
Zitat
|