gsl1982
路人甲
路人甲
  • 注册日期2004-05-08
  • 发帖数135
  • QQ
  • 铜币543枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1925回复:4

如何去除双击弹出的定制对话框,和右键点击工具栏弹出的菜单?

楼主#
更多 发布于:2004-11-18 09:43
<P>这问题有人问过,但是在论坛上没有给出答案,那个帖子好像是刘老师发的,据说他解决了。期盼各位高手及刘老师给偶们指点迷津</P>
喜欢0 评分0
gsl1982
路人甲
路人甲
  • 注册日期2004-05-08
  • 发帖数135
  • QQ
  • 铜币543枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2004-11-18 13:20
<P>问题已经搞定</P>
<P>'=======================================================
 'MyFilter.cls
 Option Explicit
 Implements ICustomizationFilter
 
 Private Function ICustomizationFilter_OnCustomizationEvent(ByVal custEventType As esriFramework.esriCustomizationEvent, ByVal eventCtx As Variant) As Boolean
     ' Lock the Visual Basic editor
     ' custEventType is esriCEShowVBAIDE
     ' eventCtx is nothing</P>
<P>    ' 锁定VBA
     If custEventType = esriCEShowVBAIDE Then
         ICustomizationFilter_OnCustomizationEvent = True
     End If
     </P>
<P>' 锁定定制对话框</P>
<P>     If custEventType = <b>esriCEShowCustDlg </b>Then
         ICustomizationFilter_OnCustomizationEvent = True
     End If

        
     ' Lock the What's This Help command. This command will not show up in the Commands
     ' list for the Help category on the Commands panel of the Customize dialog.
     ' custEventType is esriCEAddCommand
     ' eventCtx can be either a UID or a string identifier for a command.
     If custEventType = esriCEAddCommand Then
         'UID for What's This Help command
         Dim u As New UID
         u = "{81972F0D-388A-11D3-9F57-00C04F6BC61A}"
         If u = eventCtx Then
              ICustomizationFilter_OnCustomizationEvent = True
         End If
      End If
        
 End Function
</P>
<P>'=================================================
</P>
<P>Use the following code in the ThisDocument code window of the document you currently have open. </P><CODE><PRE> '=================================================
 Private Function MxDocument_OpenDocument() As Boolean
 ' Do error checking in case there is already a lock active.
     On Error GoTo lockErr
    
     'Create an instance of the custom customization filter, MyFilter
     Dim m_CustomFilter As ICustomizationFilter
     Set m_CustomFilter = New MyFilter
    
     'Lock customization using MyFilter
     Application.LockCustomization "mylock", m_CustomFilter
 Exit Function
 lockErr:
     MsgBox "There is already an active lock.", , "Lock Error"
 End Function
</PRE></CODE>
[此贴子已经被作者于2004-11-18 13:24:29编辑过]
举报 回复(0) 喜欢(0)     评分
gsl1982
路人甲
路人甲
  • 注册日期2004-05-08
  • 发帖数135
  • QQ
  • 铜币543枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2004-11-18 13:27
<P>但不知为什么用<b>esriCEShowCustCtxMenu参数没用</b></P><P>' 锁定右键弹出菜单
     If custEventType = <b>esriCEShowCustCtxMenu </b>Then
         ICustomizationFilter_OnCustomizationEvent = True
     End If
</P>
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15947
  • QQ554730525
  • 铜币25339枚
  • 威望15364点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
3楼#
发布于:2004-11-18 17:33
<a href="http://gisempire.com/bbs/dispbbs.asp?boardID=62;ID=24903;page=2" target="_blank" >http://gisempire.com/bbs/dispbbs.asp?boardID=62;ID=24903;page=2</A>
举报 回复(0) 喜欢(0)     评分
ahshegis
路人甲
路人甲
  • 注册日期2004-10-22
  • 发帖数181
  • QQ
  • 铜币847枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2004-11-18 22:06
<img src="images/post/smile/dvbbs/em01.gif" /><img src="images/post/smile/dvbbs/em01.gif" />
举报 回复(0) 喜欢(0)     评分
游客

返回顶部