|
|
<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:TOnUserInfoShow read FOnUserInfoShow write FOnUserInfoShow;//事件模型回调函数 constructor Create; end; |
|