edisonfeng 发表于 2012-12-10 13:15:00

property的使用【Delphi版】

<div id="cnblogs_post_body">一.基本声明
<div class="cnblogs_code"> TOnUserInfoShow = procedure(userName:string;userAge:Integer)of object;//定义事件模型中的回调函数原型TUserInfo = class    private      FName:string;      FAge:Integer;      FOnUserInfoShow: TOnUserInfoShow;      procedure FSetAge(theAge:Integer);    public      property Name:string read FName;//只读属性(私有变量)      property Age:Integer read FAge write FSetAge;//读写属性(私有变量,私有方法)      property OnUserInfoShow:TOnUserInfoShowread FOnUserInfoShow write FOnUserInfoShow;//事件模型回调函数      constructor Create;end;
页: [1]
查看完整版本: property的使用【Delphi版】