凤
凤舞九天
Unregistered / Unconfirmed
GUEST, unregistred user!
TlpqButton = class(TSpeedButton)
private
FlpqMouseEnter : TNotifyEvent;
FlpqMouseLeave: TNotifyEvent;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
protected
procedure paint;override;
published
property color;
property onLpqMouseEnter : TNotifyEvent read FlpqMouseEnter write FlpqMouseEnter;
end;
procedure TlpqButton.CMMouseEnter(var Message: TMessage);
begin
inherited;
if Assigned(FlpqMouseEnter) then FlpqMouseEnter(Self);
end;
procedure TlpqButton.paint;
begin
.........
end;
在程序中动态创建此btn,并赋给onMouseEnter事件后,每次鼠标进入,都会触发2次事件,不知道为什么,请大侠们帮帮忙,多谢
private
FlpqMouseEnter : TNotifyEvent;
FlpqMouseLeave: TNotifyEvent;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
protected
procedure paint;override;
published
property color;
property onLpqMouseEnter : TNotifyEvent read FlpqMouseEnter write FlpqMouseEnter;
end;
procedure TlpqButton.CMMouseEnter(var Message: TMessage);
begin
inherited;
if Assigned(FlpqMouseEnter) then FlpqMouseEnter(Self);
end;
procedure TlpqButton.paint;
begin
.........
end;
在程序中动态创建此btn,并赋给onMouseEnter事件后,每次鼠标进入,都会触发2次事件,不知道为什么,请大侠们帮帮忙,多谢