如何dbgrid的popupmenu不弹出来?

AsonLee 2003-09-17 10:53:22
当dbgrid的数据集无记录或active=false时,右击dbgrid不要弹出菜单,该如何实现?
我用以下方式都不如意

1 popupmenu的autopopup设置 true

if DmCode.ADOQueryPm.Active then

begin
if DmCode.ADOQueryPm.RecordCount=0 then
Self.PopupMenuNewPm.Items..enabled:=false;
Else Self.PopupMenuNewPm.enabled:=true;
end
Else
Self.PopupMenuNewPm.items.enabled:=false;
它的enabled还是为true

2 popupmenu的autopopup设置 false
采用mb_right click时弹出,但是弹出菜单位置的x,y值不好设置,
求解

...全文
27 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
江山易改 2003-09-17
  • 打赏
  • 举报
回复
if DmCode.ADOQueryPm.Active then

begin
if DmCode.ADOQueryPm.RecordCount=0 then
Self.PopupMenu:= nil ;
Else Self.PopupMenu := PopMenu1;
end
Else
Self.PopupMenu := nil ;

5,388

社区成员

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

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