A: The biggest trick is that when you create the memory for the TStrings property, it must be created as a TStringList even though it must be a TStrings in the class itself. Here is an example of what I mean:
unit TestEdit;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TTestEditorClass = class(TListBox)
private
{ Private declarations }
FStringListValues: TStrings;
protected
{ Protected declarations }
public
{ Public declarations }
constructor create(AOwner: TComponent); overRide;
procedure SetStringListValues(Value: TStrings);
published
{ Published declarations }
property StringListValues: tstrings read FStringListValues
write SetStringListValues;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TTestEditorClass]);
end;
constructor TTestEditorClass.create(AOwner: TComponent);
begin
inherited create(AOwner);
FStringListValues := TStringList.create;
end;
procedure TTestEditorClass.SetStringListValues(Value: TStrings);
begin
StringListValues.Assign(Value);
end;
end.