10楼#
发布于:2005-09-02 17:27
总统来看一下啊!谢谢啊!
|
|
|
11楼#
发布于:2005-09-06 10:27
还是没有人来???
|
|
|
12楼#
发布于:2005-09-07 17:17
<DIV class=quote><B>以下是引用<i>shixcn</i>在2005-8-27 20:28:16的发言:</B><br><P>Private Sub BuildPopupMenu()<BR> 'Add custom commands to the map menu<BR> Set m_pMenuMap = New ToolbarMenu<BR> m_pMenuMap.AddItem New AddData, 1, 0, False, esriCommandStyles.esriCommandStyleIconAndText<BR> m_pMenuMap.AddItem New LayerVisibility, 1, 1, True, esriCommandStyles.esriCommandStyleTextOnly<BR> m_pMenuMap.AddItem New LayerVisibility, 2, 2, False, esriCommandStyles.esriCommandStyleTextOnly</P><P> 'Add custom commands to the map menu<BR> Set m_pMenuLayer = New ToolbarMenu<BR> m_pMenuLayer.AddItem New openattribute, -1, 0, True, esriCommandStyleTextOnly<BR> m_pMenuLayer.AddItem New RemoveLayer, -1, 0, False, esriCommandStyles.esriCommandStyleIconAndText<BR> m_pMenuLayer.AddItem New ScaleThresholds, 1, 1, True, esriCommandStyles.esriCommandStyleTextOnly<BR> m_pMenuLayer.AddItem New ScaleThresholds, 2, 2, False, esriCommandStyles.esriCommandStyleTextOnly<BR> m_pMenuLayer.AddItem New ScaleThresholds, 3, 3, False, esriCommandStyles.esriCommandStyleTextOnly<BR> m_pMenuLayer.AddItem New LayerSelectable, 1, 4, True, esriCommandStyleTextOnly<BR> m_pMenuLayer.AddItem New LayerSelectable, 2, 5, False, esriCommandStyles.esriCommandStyleTextOnly<BR> m_pMenuLayer.AddItem New ZoomToLayer, -1, 6, False, esriCommandStyles.esriCommandStyleIconAndText<BR> m_pMenuLayer.AddItem New ClsSymbolSetup, -1, 7, True, esriCommandStyleTextOnly<BR> 'Add pre-defined menu to the map menu as a sub menu<BR> m_pMenuLayer.AddSubMenu "esriControlCommands.ControlsFeatureSelectionMenu", 8, True<BR> 'Set the hook of each menu<BR> m_pMenuLayer.SetHook MapControl1<BR> m_pMenuMap.SetHook MapControl1<BR>End Sub</P><img src="images/post/smile/dvbbs/em01.gif" /></DIV><p>
|
|
13楼#
发布于:2005-09-07 17:18
<P>这段代码怎么用?</P>
|
|
14楼#
发布于:2005-09-07 21:20
Icommondbar 这个接口在AE中找不到,其他都好改!
|
|
|
15楼#
发布于:2005-09-07 23:19
<P>木白林,你好。</P>
<P> <SCRIPT language=javascript type=text/javascript><br>document.write (usercolor('11','shixcn'));<br></script> <FONT face=Verdana color=#61b713><B>shixcn代码我觉得有一定作用。</B></FONT></P> <P><STRONG><FONT face=Verdana color=#61b713>我看一段帮助的代码,剪一段下来,希望对你有帮助。</FONT></STRONG></P> <P><STRONG><FONT face=Verdana color=#61b713>你可以试试!</FONT></STRONG></P> <P>Private m_pToolbarMenu As IToolbarMenu</P> <P>Private Sub Form_Load()<BR>ToolbarControl1.SetBuddyControl MapControl1<BR>Set m_pToolbarMenu = New ToolbarMenu<BR>'''''Add AE Command<BR>Dim pUid As New UID<BR>pUid.Value = "esriControlCommands.ControlsMapFullExtentCommand"<BR>m_pToolbarMenu.AddItem pUid, , , , esriCommandStyleIconAndText</P> <P>'''''Add Your Command<BR>Dim MyCommand1 As ICommand<BR>Set MyCommand1 = New MyCommand<BR>m_pToolbarMenu.AddItem MyCommand1, , , , esriCommandStyleTextOnly</P> <P><BR>m_pToolbarMenu.SetHook ToolbarControl1.Object</P> <P>End Sub</P> <P>Private Sub MapControl1_OnMouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long, ByVal mapX As Double, ByVal mapY As Double)<BR> If button = vbRightButton Then<BR> 'Popup the menu<BR> m_pToolbarMenu.PopupMenu x, y, MapControl1.hWnd<BR> End If</P> <P>End Sub</P> |
|
|
16楼#
发布于:2005-09-08 00:13
谢谢楼上的斑竹,但是你的代码实在是.....
|
|
|
17楼#
发布于:2005-09-08 08:49
<P>我写过一个,不过是TOCCONTROL 的上下文菜单</P>
|
|
18楼#
发布于:2005-09-08 10:06
<P>木白林,你好。</P>
<P>我看帮助上有一段代码,剪一段下来,希望对你有帮助。<br><br>与上面的一位朋友的代码有点类似,但有所不同</P> <P>Private m_pToolbarMenu As IToolbarMenu</P> <P>Private Sub Form_Load()<br>ToolbarControl1.SetBuddyControl MapControl1<br>Set m_pToolbarMenu = New ToolbarMenu<br>'''''Add AE Command<br>Dim pUid As New UID<br>pUid.Value = "esriControlCommands.ControlsMapFullExtentCommand"<br>m_pToolbarMenu.AddItem pUid, , , , esriCommandStyleIconAndText</P> <P>'''''Add Your Command<br>Dim MyCommand1 As ICommand<br>Set MyCommand1 = New MyCommand<br>m_pToolbarMenu.AddItem MyCommand1, , , , esriCommandStyleTextOnly</P> <P><br>m_pToolbarMenu.SetHook ToolbarControl1.Object</P> <P>End Sub</P> <P>Private Sub MapControl1_OnMouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long, ByVal mapX As Double, ByVal mapY As Double)<br> If button = vbRightButton Then<br> 'Popup the menu<br> m_pToolbarMenu.PopupMenu x, y, MapControl1.hWnd<br> End If</P> <P>End Sub</P> [此贴子已经被作者于2005-9-8 10:09:43编辑过]
|
|
|
19楼#
发布于:2005-09-08 10:48
谢谢斑竹,你说的菜单在mapcontrol中应该是固定的,不能根据我点选的区域的不同更改菜单的名字,我前面的AO菜单是通过Ipoint来识别feature从而在我点不同的乡镇时,弹出这个乡镇具体的相关菜单(XX镇地形图,XX镇土壤图等等),因为乡镇大概有30个,每个镇又有接近10种专题图,用固定的按钮或者菜单不大现实。
|
|
|