delphi.gif (306 バイト) プロパティ


このページはプロパティの作成方法の概略を説明します。

 

toach.gif (917 バイト) 継承プロパティを公開するには

type
  TMyPanel = class(TPanel)

   ....

   published
      property Align;
  
    .....
   end;

 

toach.gif (917 バイト) プロパティの宣言方法

type
  TMyEdit = class(TEdit)

  private
     FToUpper: Boolean;
     procedure SetToUpper(value: Boolean); virtual;
     function GetToUpper(): Boolean; virtual;

  published
      property ToUpper: Boolean read GetToUpper write SetToUpper;

  end;

 

toach.gif (917 バイト) 直接アクセスの指定方法

type
  TMyEdit = class(TEdit)

  private
     FToUpper: Boolean;

  published
      property ToUpper: Boolean read FToUpper write FToUpper;

  end;


toach.gif (917 バイト) デフォルトプロパティ値の指定方法

property ToUpper: Boolean read FToUpper write FToUpper default False;

 

toach.gif (917 バイト) 内部データの定義規約