控件 TComponent 继承,TMy控件
private
FListView:TListView;
published
property ListView:TListView read FListView write FListView;
end;放到界面上,设置一个 ListView后,如果将 ListView 直接删除或Ctrl+X 掉,控件就出错?
怎么解决呢????????
private
FListView:TListView;
published
property ListView:TListView read FListView write FListView;
end;放到界面上,设置一个 ListView后,如果将 ListView 直接删除或Ctrl+X 掉,控件就出错?
怎么解决呢????????
要加一个
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
begin
inherited;
if opRemove=Operation then //opInsert, opRemove
begin
Showmessage(AComponent.ClassName );
FListView:=nil;
end;
end;
FListView:=nil;建议而已。
不过,既然解决了,散分吧。