Office中国论坛/Access中国论坛

标题: 在VBE 里增加右键菜单 [打印本页]

作者: 闻启学    时间: 2014-4-29 17:19
标题: 在VBE 里增加右键菜单
经过一段时间摸索
终于成功了  主要代码分享下 这个是在右键菜单生成一个按钮的    大家都要加油

  1.      mycommBatbtn = (CommandBarButton)GetExApp().VBE.CommandBars["Code Window"].Controls.Add(Microsoft.Office.Core.MsoControlType.msoControlButton, 1, 2, 1);
  2.           //  mycommBatbtn.Picture = "";  图片
  3.             mycommBatbtn.Style = MsoButtonStyle.msoButtonIconAndCaption; //设置按钮样式
  4.             mycommBatbtn.Caption = "正在进行中";  //显示标题
  5.             mycommBatbtn.FaceId = 6;  //按钮的图标
  6.             mycommBatbtn.Click+=mycommBatbtn_Click;  //按钮的事件
复制代码




作者: 醉酒狂生    时间: 2014-4-29 17:24
小闻顶呱呱
作者: admin    时间: 2014-4-29 17:59
不错哦,加油!
作者: zhuyiwen    时间: 2014-4-30 14:00
支持
作者: wh133@163.com    时间: 2017-12-31 21:00
VBE




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3