I need help on how to implement class that can be shown in object Inspector

后端 未结 2 627
孤城傲影
孤城傲影 2020-12-20 09:12

i have

...
  TDispPitch = class
  private
    iLineSize: Integer;
    iLineColor: TColor;
    bDisplayAccent: Boolean;
    bVisible: Boolean;
  published
            


        
2条回答
  •  难免孤独
    2020-12-20 09:46

    You must derive your class from TPersistent, or a descendant, in order to make it available in the Object Inspector:

    TDispPitch = class(TPersistent)
    private
      ...
    published
      property ...
      ...
    end;
    

    From Delphi Documentation:

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

提交回复
热议问题