[Delphi] Problem z komponentem 2

0

Chcę zrobić komponent, który będzie rysował tekst (jak memo). Dodałem właściwość lines w Object inspector , przy próbie dodania czegoś do listy pojawia się błąd.
Próbowałem na różne sposoby, ale zawsze pojawiały się błędy. :-(
Bardzo proszę o pomoc i przykłady!!!!

Podajękod komponentu

unit Mojkomponent;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
TMojkomponent = class(TGraphicControl)
private
FLines: TStrings;
procedure SetLines(Value: TStrings);
protected

public
constructor Create(AOwner : TComponent); override;
destructor Destroy; override;
published
property Lines: TStrings read FLines write SetLines default nil;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents('Standard', [TMojkomponent]);
end;

constructor TMojkomponent.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
end;

destructor TMojkomponent.Destroy;
begin
inherited Destroy;
end;

procedure TMojkomponent.SetLines(Value: TStrings);
begin

end;

end.

0

Przy tworzeniu komponentu musisz także tworzyć TStrings, inaczej nie możesz się do niego odwoływać :)

1 użytkowników online, w tym zalogowanych: 0, gości: 1