定义事件过程类型
2012-12-27 17:05
197 查看
// TonEvent = procedure of object; //定义事件过程类型后加面加 of object Tcls = class private FonEvent: TNotifyEvent; public procedure show(sender: TObject); property onEvent: TNotifyEvent read FonEvent write FonEvent; constructor create; end; var Form1: TForm1; implementation {$R *.dfm} constructor Tcls.create; begin FonEvent := show; end; procedure Tcls.show; begin ShowMessage('触发事件'); end; procedure TForm1.Button1Click(Sender: TObject); var Tc: Tcls; begin Tc := Tcls.Create; Tc.onEvent(Sender); Tc.Free; end;
相关文章推荐
- Duilib 事件类型定义
- 类型事件定义
- 创建一个包,其中定义一个过程,可以查询得到编号为7900的员工的姓名ename、薪水sal、佣金comm、上司编号mgr (通过OUT类型的参数将结果返回并打印) (注意包有包头部分的声明和包体部分的
- oracle的学习六:pl/sql基础(数据类型、定义变量)、游标、过程、函数、包、触发器(系统触发器)
- C# 001 --- 正确的删除一个控件的事件函数 --- 解决错误: “A”不包含“B”的定义,并且找不到可接受类型为“A”的第一个参数的扩展方法“B”(是否缺少 using 指令或程序集引用?)
- SQL Server 2008 调试存储过程(调用用户定义表类型)
- 类型事件定义
- 存储过程变量类型定义与表字段一致
- 存储过程中定义参数类型为数组
- 修改用户定义数据类型对已经编译的存储过程的影响的示例.sql
- .net 在类中的Event事件,为什么可以定义为static?而委托类型却不可以
- 关于页面不包含"事件_Click"的定义 并且找不到可接受页面类型的第一个参数的扩展方法"事件_Click" 的解决方案
- SQL SERVER 使用存储过程创建、删除用户定义数据类型
- JavaScript基础 事件 定义 及 捕获冒泡过程
- SQL 用户定义表类型,在存储过程里使用数据类型作參数
- SQL 用户定义表类型,在存储过程里使用表类型,表参数作参数
- SQL 用户定义表类型,在存储过程里使用数据类型作参数
- cocos2d-x游戏引擎核心(3.x)----事件分发机制之事件从(android,ios,desktop)系统传到cocos2dx的过程浅析
- 第一部分 基本语言 第二章 变量和基本类型(2.3.5声明和定义)
- float类型在值传递过程中出现的问题