Q&A

  • 컴포넌트를 만들려고 하는데요 잘 안되서요?
type
  TComboButton = class(TCustomPanel)
  private
    { Private declarations }
    FButton : TdxButton;
    FComboBox : TComboBox;
    FClick, FSelect : TNotifyEvent;
    FDropWidth : Integer;

  protected
    { Protected declarations }
    Procedure doClick(Sender:TObject);
    Procedure doDropDown(Sender:TObject);
    Procedure doSelect(Sender:TObject);

  public
    { Public declarations }
    Constructor Create(AOwner:TComponent); override;
    Destructor Destroy; override;

  published
    { Published declarations }
    property Button : TdxButton read FButton;
    Property ComboBox : TComboBox read FComboBox;
    Property OnClick : TNotifyEvent read FClick write FClick;
    Property OnSelect : TNotifyEvent read FSelect write FSelect;
    Property DropWidth : Integer read FDropWidth write FDropWidth;
  end;

위에서요 property에 Caption을만들려고 하는데 컴파일하면 caption명이 사라지더군요 어떻게 해야하나요?
1  COMMENTS
  • Profile
    소울해커 2003.12.30 23:05
    private
      FCaption: String;
      procedure setCaption(const Value: String);

    published
      property Caption: string read FCaption write setCaption;


    implementation

    procedure TComboButton.setCaption(const Value: String);
    begin
         FCaption := Value;
         Invalidate;
    end;

    이렇게 하시면 될것이라 생각합니다.
    (직접 확인해보진 않았어요. ^^;)