{ I'm wanting to create a set of columns on a TCustomControl similar to TListView in report style I'm lacking an example to follow that uses TCollection and TCollectionItem descendants 1. Can some try to fill in the gaps for me to give me an example to work from. 2. I expect thier in no changes if I used TComponet as my main object } unit UComponentEdit; interface uses Messages, Windows, SysUtils, Classes, Graphics, Menus, Controls, Forms, StdCtrls, Mask, Commctrl, dsgnintf; const ColumnHeaderWidth = LVSCW_AUTOSIZE_USEHEADER; ColumnTextWidth = LVSCW_AUTOSIZE; type TWidth = ColumnHeaderWidth..MaxInt; {TDefaultEditor??} TMyComponentEditor = class(TComponentEditor) public procedure ExecuteVerb(Index: Integer); override; function GetVerb(Index: Integer): string; override; function GetVerbCount: Integer; override; end; TMyCollection = class; TMyComponent = class; TMyCollectItem = class(TCollectionItem) private FAlignment: TAlignment; FCaption: string; FMaxWidth: TWidth; FMinWidth: TWidth; FImageIndex: Integer; FWidth: TWidth; function GetWidth: TWidth; function IsWidthStored: Boolean; procedure SetAlignment(Value: TAlignment); procedure SetCaption(const Value: string); procedure SetImageIndex(Value: Integer); procedure SetMaxWidth(Value: TWidth); procedure SetMinWidth(Value: TWidth); procedure SetWidth(Value: TWidth); protected procedure DefineProperties(Filer: TFiler); override; function GetDisplayName: string; override; public constructor Create(Collection: TCollection); override; destructor Destroy; override; procedure Assign(Source: TPersistent); override; property WidthType: TWidth read FWidth; published property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; property Caption: string read FCaption write SetCaption; property ImageIndex: Integer read FImageIndex write SetImageIndex default -1; property MaxWidth: TWidth read FMaxWidth write SetMaxWidth default 0; property MinWidth: TWidth read FMinWidth write SetMinWidth default 0; property Width: TWidth read GetWidth write SetWidth stored IsWidthStored default 50; end; TMyCollection = class(TCollection) private FOwner: TMyComponent; function GetItem(Index: Integer): TMyCollectItem; procedure SetItem(Index: Integer; Value: TMyCollectItem); protected function GetOwner: TPersistent; override; procedure Update(Item: TCollectionItem); override; public constructor Create(AOwner: TMyComponent); function Add: TMyCollectItem; property Owner: TMyComponent read FOwner; property Items[Index: Integer]: TMyCollectItem read GetItem write SetItem; default; end; TMyComponent = class(TCustomControl) private FCollection: TMyCollection; procedure SetColumns(const Value: TMyCollection); function TMyCollection: TMyCollection; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; Published property Columns: TMyCollection read TMyCollection write SetColumns; end; Procedure Register; implementation Procedure Register; begin RegisterComponents('System', [TMyComponent]); RegisterComponentEditor(TMyComponent, TMyComponentEditor); end; { TMyComponentEditor } procedure TMyComponentEditor.ExecuteVerb(Index: Integer); begin inherited; // do not know what to do hear- dose it grow with TMyCollectItem's count ShowCollectionEditor(Designer, TMyCollection, TMyComponent.Columns[Index], 'TMyCollection'); end; function TMyComponentEditor.GetVerb(Index: Integer): string; begin Result := ''; case Index of 0: Result := 'Edit MyOwnedCollection'; end; end; function TMyComponentEditor.GetVerbCount: Integer; begin Result := 1; end; { TMyComponent } constructor TMyComponent.Create(AOwner: TComponent); begin end; destructor TMyComponent.Destroy; begin end; procedure TMyComponent.SetColumns(const Value: TMyCollection); begin end; function TMyComponent.TMyCollection: TMyCollection; begin end; { TMyCollection } function TMyCollection.Add: TMyCollectItem; begin Result := nil; end; constructor TMyCollection.Create(AOwner: TMyComponent); begin end; function TMyCollection.GetItem(Index: Integer): TMyCollectItem; begin Result := nil; end; function TMyCollection.GetOwner: TPersistent; begin Result := nil; end; procedure TMyCollection.SetItem(Index: Integer; Value: TMyCollectItem); begin end; procedure TMyCollection.Update(Item: TCollectionItem); begin end; { TMyCollectItem } procedure TMyCollectItem.Assign(Source: TPersistent); begin end; constructor TMyCollectItem.Create(Collection: TCollection); begin end; procedure TMyCollectItem.DefineProperties(Filer: TFiler); begin end; destructor TMyCollectItem.Destroy; begin end; function TMyCollectItem.GetDisplayName: string; begin end; function TMyCollectItem.GetWidth: TWidth; begin Result := 0; end; function TMyCollectItem.IsWidthStored: Boolean; begin Result := false; end; procedure TMyCollectItem.SetAlignment(Value: TAlignment); begin end; procedure TMyCollectItem.SetCaption(const Value: string); begin end; procedure TMyCollectItem.SetImageIndex(Value: Integer); begin end; procedure TMyCollectItem.SetMaxWidth(Value: TWidth); begin end; procedure TMyCollectItem.SetMinWidth(Value: TWidth); begin end; procedure TMyCollectItem.SetWidth(Value: TWidth); begin end; end.