I have a custom component that I create that is derived from TCustomListView.
I need to override a method, in particular a method GetImageIndex, but I cannot access it.
The component that I create should behave like TListView, but without a lot of published properties and methods that it has, since I will create my own component, so I get it instead TCustomListView.
In my component, I tried to access GetImageIndexas follows:
TMyListView = class(TCustomListView)
strict protected
procedure GetImageIndex(Sender: TObject; Item: TListItem); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
procedure TMyListView.GetImageIndex(Sender: TObject; Item: TListItem);
begin
inherited;
// Make my changes
end;
Obviously, the above is abbreviated for the purposes of the example.
I encounter a compilation error:
Method GetImageIndexnot found in base class
? , , , , ?
, , . -, , 1, .
:
protected
procedure GetImageIndex(Sender: TObject; Item: TListItem);
:
constructor TMyListView.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
OnGetImageIndex := GetImageIndex;
end;
, , , .
user1175743