阅读:2074回复:4
如何去除双击弹出的定制对话框,和右键点击工具栏弹出的菜单?
<P>这问题有人问过,但是在论坛上没有给出答案,那个帖子好像是刘老师发的,据说他解决了。期盼各位高手及刘老师给偶们指点迷津</P>
|
|
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编辑过]
|
|
2楼#
发布于:2004-11-18 13:27
<P>但不知为什么用<b>esriCEShowCustCtxMenu参数没用</b></P><P>' 锁定右键弹出菜单
If custEventType = <b>esriCEShowCustCtxMenu </b>Then ICustomizationFilter_OnCustomizationEvent = True End If </P> |
|
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>
|
|
|
4楼#
发布于:2004-11-18 22:06
<img src="images/post/smile/dvbbs/em01.gif" /><img src="images/post/smile/dvbbs/em01.gif" />
|
|