继承TListView的CustomDrawItem事件 ( 积分: 24 )

  • 主题发起人 主题发起人 网中戏
  • 开始时间 开始时间

网中戏

Unregistered / Unconfirmed
GUEST, unregistred user!
type
TnewListView = class(TListView)
private
{ Private declarations }
protected
procedure CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); [red]override[/red];
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
出现下面错误!如何解决?
[Error] newListView.pas(13): Declaration of 'CustomDrawItem' differs from previous declaration
 
type
TnewListView = class(TListView)
private
{ Private declarations }
protected
procedure CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); [red]override[/red];
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
出现下面错误!如何解决?
[Error] newListView.pas(13): Declaration of 'CustomDrawItem' differs from previous declaration
 
procedure CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); override;

定义有问题,应该和以前一样,如果不一样,需要使用overload关键字
 

Similar threads

后退
顶部