<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MouseDown pass through of right click in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185372#M4831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the code editor, choose ContextMenu from the right-hand dropdown list and have it return False.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Oct 2010 19:37:42 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2010-10-18T19:37:42Z</dc:date>
    <item>
      <title>MouseDown pass through of right click</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185371#M4830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have created a UIToolControl in VBA that I would like to activate only if the left mouse button is clicked within the map.&amp;nbsp; However, if the right mouse button is clicked I would like the normal ArcMap context menu to be activated.&amp;nbsp; I know how to test for the left button event, but if all I do is determiine that another button was clicked and exit the sub, no context menu is activated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I have to explicitly call the context menu when the right mouse button is clicked or can I somehow pass the right click event to ArcMap?&amp;nbsp; What do I need to do to get the right mouse click to activate the normal ArcMap context menu when my tool is active?&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 15:47:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185371#M4830</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2010-10-18T15:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: MouseDown pass through of right click</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185372#M4831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the code editor, choose ContextMenu from the right-hand dropdown list and have it return False.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 19:37:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185372#M4831</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2010-10-18T19:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: MouseDown pass through of right click</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185373#M4832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In the code editor, choose ContextMenu from the right-hand dropdown list and have it return False.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply.&amp;nbsp; I added the code below but the behavior of the tool has not changed and the code below is not fired.&amp;nbsp; I still do not get a context menu if the right button is clicked.&amp;nbsp; What am I missing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Function UIToolControl1_ContextMenu(ByVal x As Long, ByVal y As Long) As Boolean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; UIToolControl1_ContextMenu = False&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Oct 2010 20:46:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185373#M4832</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2010-10-18T20:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: MouseDown pass through of right click</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185374#M4833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Neil thanks for the suggestion.&amp;nbsp; I got the ContextMenu to work after looking at some of your other older posts.&amp;nbsp; In addition to setting the ContextMenu value to False I also had to alter the Mousedown behavior to detect the right-click button and send the clicked coordinates to the ContextMenu of the tool.&amp;nbsp; So the minimum code required to get the behavior I wanted is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Private Function UIToolControl1_ContextMenu(ByVal x As Long, ByVal y As Long) As Boolean
&amp;nbsp; UIToolControl1_ContextMenu = False
End Function

Private Sub UIToolControl1_MouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
&amp;nbsp; If button = 2 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; UIToolControl1_ContextMenu x, y
&amp;nbsp; ElseIf button = 1 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Whatever the tool does
&amp;nbsp; End If
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:24:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/mousedown-pass-through-of-right-click/m-p/185374#M4833</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2021-12-11T09:24:07Z</dc:date>
    </item>
  </channel>
</rss>

