请问:
自己写一个控件,其中聚合了自己写的另一个类。请问,如何使这个类的属性在控件属性列表中列出来? TMyClass = class(TObject)
private
FMyProperty: Integer;
procedure SetMyProperty(const Value: Integer);
published
property MyProperty: Integer read FMyProperty write SetMyProperty;
end; TMyControl = class(TCustomControl)
private
FItem: TMyClass;
published
property Item: TMyClass read FItem;
end;如何在 TMyControl 的属性表中显示出 TMyClass 的 MyProperty 属性
自己写一个控件,其中聚合了自己写的另一个类。请问,如何使这个类的属性在控件属性列表中列出来? TMyClass = class(TObject)
private
FMyProperty: Integer;
procedure SetMyProperty(const Value: Integer);
published
property MyProperty: Integer read FMyProperty write SetMyProperty;
end; TMyControl = class(TCustomControl)
private
FItem: TMyClass;
published
property Item: TMyClass read FItem;
end;如何在 TMyControl 的属性表中显示出 TMyClass 的 MyProperty 属性
原来需要在 TMyControl 初始化的时候创建 TMyClass 然后才能显示出 TMyClass 的属性呀。哈哈