频道分类

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

作者:admin 来源: 日期:2020/3/23 9:00:21 人气: 标签:

 
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读取RadioGroup选中按钮的string文本下一篇:没有资料