好象是不行,OnClick为TNotifyEvent,强加就挂不上单击事件
要不自己写个控件处理相应消息来调用自己定义的事件不知要增加什么类型的参数
可把Sender转为TButton,取他的Tag
要不自己写个控件处理相应消息来调用自己定义的事件不知要增加什么类型的参数
可把Sender转为TButton,取他的Tag
解决方案 »
- 给我初学者,想深入的掌握Delphi!
- 为什么用SENDTEXT发过去的串,客户端收到的有时是乱码?用SEDNBUF有时也是乱码?谢谢!
- 如何从url地址中提取路径
- 大虾们圣诞快乐!小弟想问个ClientSocket的菜问题,谢谢!!!
- 高手请进:一个简单的问题
- 有两个adoquery1,adoquery2,如何设置他的主从关系?
- 江湖救急——请问如何用程序改变FastReport里的字段列表的名字,
- 明天十六大就要召开了,谁能告诉我哪儿有网上直播?
- delphi添加数据时报错
- 用sql统计的问题
- 知道一个字段,要查找等于此字段的一条记录,并将焦点放到这条记录上,在D6上locate好象不行。有别的办法吗?
- 请问怎么让状态栏显示鼠标指向的菜单标题
Windows, Messages, SysUtils, Classes, Controls, StdCtrls;type
TMyEvent = procedure(Sender: TObject; A: Integer) of object; TMyTestEdit = class(TEdit)
private
{ Private declarations }
FOnMyClick: TMyEvent;
FTest: Integer;
procedure DoClick(var Msg: TWMMBUTTONDBLCLK); message WM_MBUTTONDBLCLK;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property OnMyClick: TMyEvent read FOnMyClick write FOnMyClick;
property Test: Integer read FTest write FTest;
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Sample', [TMyTestEdit]);
end;{ TMyTestEdit }procedure TMyTestEdit.DoClick(var Msg: TWMMBUTTONDBLCLK);
begin
if Assigned(FOnMyClick) then
FOnMyClick(Self, Test);
inherited;
end;end.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, MyTestEdit;type
TForm1 = class(TForm)
MyTestEdit1: TMyTestEdit;
procedure MyTestEdit1MyClick(Sender: TObject; A: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.MyTestEdit1MyClick(Sender: TObject; A: Integer);
begin
ShowMessage(IntToStr(A));
end;end.