You should do
procedure SetLines(Lines: TStrings);
begin
FLinesText.Assign(Lines);
// Repaint, update or whatever you need to do.
end;
You may also need to set the OnChange
property of the FLines
(do this in the constructor of your custom control, as soon as you have created it). Set it to any TNofifyEvent
-compatible (private or protected, I guess) procedure of your component. In this procedure, you can do the repainting, updating etc. you need.
That is, do
constructor TControlPanelItem.Create(AOwner: TComponent);
begin
inherited;
FLinesText := TStringList.Create;
TStringList(FLinesText).OnChange := LinesChanged;
end;
procedure TControlPanelItem.LinesChanged(Sender: TObject);
begin
// Repaint, update or whatever you need to do.
end;
Andreas Rejbrand
2010-10-29 09:28:07