XBa*_*000 0 delphi properties class object custom-component
我有
...
TDispPitch = class
private
iLineSize: Integer;
iLineColor: TColor;
bDisplayAccent: Boolean;
bVisible: Boolean;
published
property LineSize : Integer read iLineSize write iLineSize;
...etc
end;
...
Run Code Online (Sandbox Code Playgroud)
我想要在Object Insepector中显示此功能来编辑设置.
我尝试添加
property DispPitch: TDispPitch read FDispPitch write FDispPitch. like
Run Code Online (Sandbox Code Playgroud)
可以显示DispPitch,但我看不到它的属性.比如LineSize,LineColor等
您必须从TPersistent,或后代派生您的类,以使其在Object Inspector中可用:
TDispPitch = class(TPersistent)
private
...
published
property ...
...
end;
Run Code Online (Sandbox Code Playgroud)
来自Delphi文档:
TPersistent是具有赋值和流功能的所有对象的祖先.