我想创建一个类,从SPComm控件里申明的Tcomm继承,
TReadCardComm=class(TComm)
但不知该如何捕获里面的
ReceiveData(Sender: TObject; Buffer: Pointer;BufferLength: Word);事件,你有什么办法吗?
谢谢指导
TReadCardComm=class(TComm)
但不知该如何捕获里面的
ReceiveData(Sender: TObject; Buffer: Pointer;BufferLength: Word);事件,你有什么办法吗?
谢谢指导
解决方案 »
- 请给推荐几本讲DELPHI基本语法的书或资料
- 求助,字符串操作
- 我想将str中的涉及到inf中的字串,用upmsg中对应的字串来替换掉?
- 请教以函数方式给数组赋值的写法?
- ■■■■■■■出售“IC卡考勤/门禁系统” http://www.n3software.com■■■■■■■■
- ACCESS数据库中有像Graphic这样的数据类型吗?
- 100分求教:三层结构中的客户端怎样做事务处理?
- 菜鸟又来了,关于网络编程
- 用StringGrid怎样实现定位
- 请问:为什么程序编译运行可以,但是F8单步运行到数据模块的创建时“执行非法操作”?
- 什么样的类型可以接收这样的函数参数 func([12,321])
- 求写一条SQL语句,有点复杂急用....??
create时
inherited Create(AOwner);
从TButton继承一个新的TMyButton
我要在TButton Onclick的时候做手脚找到property OnClick: TNotifyEvent read FOnClick write FOnClick stored IsOnClickStored;在源代码中查找何处触发OnClick(搜索FOnclick)
procedure TControl.Click;
begin
{ Call OnClick if assigned and not equal to associated action's OnExecute.
If associated action's OnExecute assigned then call it, otherwise, call
OnClick. }
if Assigned(FOnClick) and (Action <> nil) and (@FOnClick <> @Action.OnExecute) then
FOnClick(Self)
else if not (csDesigning in ComponentState) and (ActionLink <> nil) then
ActionLink.Execute
else if Assigned(FOnClick) then
FOnClick(Self);
end;因此,只需要重载Click在调用FOnClick(Self)之前或者之后插入自己要的代码就OK
myProcedure(Sender: TObject; Buffer: Pointer;BufferLength: Word);然后xxxx.OnReceiveData := myProcedure;
begin
{ Call OnClick if assigned and not equal to associated action's OnExecute.
If associated action's OnExecute assigned then call it, otherwise, call
OnClick. }
if Assigned(FOnClick) and (Action <> nil) and (@FOnClick <> @Action.OnExecute) then
FOnClick(Self)
else if not (csDesigning in ComponentState) and (ActionLink <> nil) then
ActionLink.Execute
else if Assigned(FOnClick) then
FOnClick(Self);
end;
//这段代码是什么意思呀,看到的人谁能解释一下呀吗?我就是楼主,这是一位朋友给我的答案,但我看不懂。拜托拉
调用onclick事件在以下情况:
1.onclick定义,而且不是action事件
2.是action事件,并且onexecute定义
3.其他
然后代码就是判断这些