DELPHI與.Net

程序開發中......... [注明:该Blog中的信息都并非原创,只是作为个人的阅读笔记]

vcl.net overload学习

type

  Tmyclass =class(System.Object)
  private
    Fname: string;

    public

    procedure set_name(const Value: string);
    property name:string read Fname write set_name;

    constructor Create; overload;

    constructor Create(const setprivate:string);overload;


  end;

{ Tmyclass }


procedure TForm1.Button2Click(Sender: TObject);
  var s:Tmyclass;
begin
   s :=Tmyclass.Create ;
   s.name :='小贺';
   showmessage(s.name)

end;

constructor Tmyclass.Create;
begin
  inherited;
end;

constructor Tmyclass.Create(const setprivate: string);
begin
  Fname := setprivate;
  inherited Create;
//这个很重要,一定要加上,.......

end;

procedure Tmyclass.set_name(const Value: string);
begin
  Fname := Value;
end;

posted on 2005-08-06 22:26  人淡如菊  阅读(270)  评论(0编辑  收藏  举报

导航