我有
... TDispPitch = class private iLineSize: Integer; iLineColor: TColor; bDisplayAccent: Boolean; bVisible: Boolean; published property LineSize : Integer read iLineSize write iLineSize; ...etc end; ...
我想在Object Insepector中显示此功能来编辑设置.
我尝试添加
property DispPitch: TDispPitch read FDispPitch write FDispPitch. like
解决方法
您必须从TPersistent或后代派生您的类,以使其在Object Inspector中可用:
TDispPitch = class(TPersistent) private ... published property ... ... end;
来自Delphi文档:
TPersistent is the ancestor for all objects that have assignment and streaming capabilities.