delphi检测当前鼠标点击处是否在指定控件内部


本文整理自网络,侵删。

 
procedure TForm1.PopupMenu1Popup(Sender: TObject);
var
  mouse:TPoint;
  mouse_in_memo:Boolean;
begin
  GetCursorPos(mouse);
  mouse:=ScreenToClient(mouse);
  if mouse.Y <= (Memo1.Top+Memo1.Height) then
    mouse_in_memo:=true
  else
    mouse_in_memo:=false;
  N6.Enabled:=mouse_in_memo;
  N7.Enabled:=mouse_in_memo;
end;

http://blog.chinaunix.net/uid-20564848-id-74478.html

相关阅读 >>

Delphi 记事本与计算器的调用

Delphi tdictionary保存到文件

Delphi windows 获取指定进程句柄数

Delphi xe下文件转base64编码函数

Delphi getrandompassword 生成随机密码

Delphi 主程序装载脚本

Delphi firemonkey的tedit七大变化

Delphi命令行窗口实现9*9乘法表

Delphi 查询当前目录下文件名是否存在

Delphi 修改窗口标题

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...