dan800913
路人甲
路人甲
  • 注册日期2005-01-10
  • 发帖数102
  • QQ
  • 铜币617枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2481回复:5

toccontrol右键菜单子菜单功能不可用

楼主#
更多 发布于:2005-10-17 14:53
<P>我现在实现了toccontrol右键菜单,但是想通过itoolbarmenu.addsubmenu方法来构建子菜单,结果本来在主菜单中可以实现的功能,移植到子菜单中之后,就处于冻结状态,相关代码如下,请大家帮忙看看!<BR>m_Pmenuglobe = New ToolbarMenuClass<BR>        m_Pmnulayersvis = New ToolbarMenuClass<BR>        m_Pmnulayersvis.Caption = "图层可见性"<BR>               m_Pmnulayersvis.AddItem(New layersvis, 1, 0, False, esriCommandStyles.esriCommandStyleTextOnly)<BR>        m_Pmnulayersvis.AddItem(New layersvis, 2, 1, False, esriCommandStyles.esriCommandStyleTextOnly)<BR>               m_Pmenuglobe.AddSubMenu(m_Pmnulayersvis, 0, False)<BR>        m_Pmenuglobe.AddItem(New globepros, -1, 1, True, esriCommandStyles.esriCommandStyleTextOnly)</P>
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-11-03 10:35
<P>在开发包里有个 PopupMenu的例子</P>
<P>Description: <BR><BR>This sample demonstrates creating a popup menu and uses the ToolbarControl in conjunction with the MapControl and Control Commands. </P>
<br>
<P>The AddItem method is used within the Form_Load event to add new item's to the ToolbarControl with their Style set. An IMenuDef object is created from a menu defined within the same application. The menu is defined within a class implementing the IMenuDef interface and is made up of default ToolbarControl commands. This MenuDef is added to a ToolbarMenu using the AddItem method and the ToolbarMenu's Hook property is set to the ToolbarControl. Within the MapControl's OnMouseDown event the PopupMenu method is used to display the ToolbarMenu when the right mouse button has been used. </P>
举报 回复(0) 喜欢(0)     评分
fisherssj
路人甲
路人甲
  • 注册日期2004-06-29
  • 发帖数65
  • QQ
  • 铜币52枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2005-11-24 14:52
.net中不行?
这个世界究竟是什么样子?
举报 回复(0) 喜欢(0)     评分
dan800913
路人甲
路人甲
  • 注册日期2005-01-10
  • 发帖数102
  • QQ
  • 铜币617枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2005-12-05 21:14
这个问题我还是没有解决,以前没有用子菜单的时候还是可以用的,当修改成为利用子菜单之后,就不能用了,而且右键菜单也不出来了,我检查了程序没有问题啊!不知道什么原因!
举报 回复(0) 喜欢(0)     评分
一剑飘红
路人甲
路人甲
  • 注册日期2006-02-22
  • 发帖数7
  • QQ
  • 铜币168枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2006-08-30 20:02
好贴
举报 回复(0) 喜欢(0)     评分
hahaaluo
路人甲
路人甲
  • 注册日期2006-08-05
  • 发帖数146
  • QQ
  • 铜币591枚
  • 威望0点
  • 贡献值0点
  • 银元0个
5楼#
发布于:2006-09-01 11:39
恩是这样的,我也是,就是不能right click的
举报 回复(0) 喜欢(0)     评分
游客

返回顶部