Link to home
Start Free TrialLog in
Avatar of delpro
delpro

asked on

Try to create a component with a TStrings property

I try to create a comonent
When i put the component on a form and click on nstring I get an Abstract Error.


unit Str;
interface
uses
  Windows, Messages, SysUtils, Classes, StdCtrls;
type
  TStr = class(TComponent)
  private
  protected
    astring : TStrings;
  public
    constructor Create(AOwner: TComponent);  override;
    destructor Destroy; override;
  published
    property nstring: TStrings READ astring WrITE astring;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Samples', [TStr]);
end;

constructor TStr.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  astring := TStrings.Create;
end;

destructor TStr.Destroy;
begin
 inherited Destroy;
end;

end.
ASKER CERTIFIED SOLUTION
Avatar of Igor UL7AAjr
Igor UL7AAjr
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial