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 xe5在zip文件中添加某个txt文件并写入文字

Delphi 生成并替换txt里的内容

Delphi 资源管理器套件

unigui js操作Delphi控件赋值

Delphi html转义字符编码转换

Delphi makeuniquefilename 创建文件名如果已经存在自动更改文件名

Delphi拖动窗体超简单实现

Delphi基于高斯-拉普拉斯算子的图像边缘检测

Delphi 用idhttp获取utf-8编码的网页

Delphi tstringdynarray 使用,分割字符串

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



打赏

取消

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

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

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

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

评论

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