加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

delphi – 我需要有关如何实现可以在对象Inspector中显示的类的

发布时间:2020-12-15 10:04:16 所属栏目:大数据 来源:网络整理
导读:我有 ... TDispPitch = class private iLineSize: Integer; iLineColor: TColor; bDisplayAccent: Boolean; bVisible: Boolean; published property LineSize : Integer read iLineSize write iLineSize; ...etc end;... 我想在Object Insepector中显示此功
我有
...
  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

可以显示DispPitch但我看不到它的属性.比如LineSize,LineColor等

解决方法

您必须从TPersistent或后代派生您的类,以使其在Object Inspector中可用:
TDispPitch = class(TPersistent)
private
  ...
published
  property ...
  ...
end;

来自Delphi文档:

TPersistent is the ancestor for all objects that have assignment and streaming capabilities.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读