如何判断鼠标移开按钮

shacy 2003-10-09 12:03:41
我知道用WMMOUSELEAVE消息。由于新手,我不知道应该如何写?我这样写的:
procedure TBrowserForm.WMMouseLeave(var Msg:TWMMouse);
begin
LoadImageButton;
inherited;
end;

这样写,才可以执行。但是我需要获得鼠标移开按钮的消息,应该如何写?请各位指教菜鸟。
...全文
56 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
IORILI 2003-10-09
  • 打赏
  • 举报
回复
这个问题俺不会,你看看一楼的答案对不对
ZyxIp 2003-10-09
  • 打赏
  • 举报
回复
进去和出来
procedure CMMouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;

procedure TLabelEx.CMMouseEnter(var Msg: TMessage);
begin
FOldColor := Font .Color ;
// if msg.LParam=integer(pc_Main ) then
// showmessage('fsdkfs');
Font.Color :=ColorMove;
self.Top :=self.Top -1;
Font.Style :=Font.Style+[fsunderline];
end;

procedure TLabelEx.CMMouseLeave(var Msg: TMessage);
begin
Font.Color :=FOldColor;
self.Top :=self.Top +1;
Font.Style :=Font.Style-[fsunderline];
end;
shacy 2003-10-09
  • 打赏
  • 举报
回复
谢谢大家解决了。
delphi_xizhousheng 2003-10-09
  • 打赏
  • 举报
回复
procedure WMMouseLeave(var Msg:TWMMouse);); message CM_MOUSELEAVE


procedure TBrowserForm.WMMouseLeave(var Msg:TWMMouse);
begin
LoadImageButton;
inherited;
end;
delphi_xizhousheng 2003-10-09
  • 打赏
  • 举报
回复
TLabelEx是人家自己命名的窗体的名字啦,换成你自己的就行了 TForm1
shacy 2003-10-09
  • 打赏
  • 举报
回复
请问 ZyxIp(绝望中...) ,TLabelEx是按钮的名字吗?为什么我一写成按钮就出错?写成所在的窗体的名字没错?提示的错误为";"expected but found "."。原来没错。

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧