请各位大虾赐教!

解决方案 »

  1.   


    public
      property 属性名:类型 read .. write .. ;
      

  2.   

    read 和 write 后面可以是字段名也可以是过程名
      

  3.   

    TStudent = class(TObject)
    private
      FAge: Integer;
      FName: string;    procedure SetAge(Value: Integer);
      procedure SetName(Value: string);
    public
      property Age: Integer read FAge write SetAge;
      property Name: string read FName wirte SetName;end;