<?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: Disable a command button within an Add-In in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178533#M4608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I solved the crashing issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. I removed "OnDemand = false" from the Config.esriaddinx.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I deleted the current add-in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. I deleted the Normal.mnt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now my question is, How do you disable a command button add-in when ArcMap is started?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2013 12:51:39 GMT</pubDate>
    <dc:creator>GenaroGarcia</dc:creator>
    <dc:date>2013-10-21T12:51:39Z</dc:date>
    <item>
      <title>Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178532#M4607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Genaro Garcia&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to disable a command button within an Add-In when ArcMap is started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added "OnDemand = false" option in the Config.esriaddinx, but still not working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It actually crashes ArcMap. See attached document to view the code and error message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I may be doing something wrong, but not sure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 15:14:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178532#M4607</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-10-17T15:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178533#M4608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I solved the crashing issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. I removed "OnDemand = false" from the Config.esriaddinx.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I deleted the current add-in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. I deleted the Normal.mnt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now my question is, How do you disable a command button add-in when ArcMap is started?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 12:51:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178533#M4608</guid>
      <dc:creator>GenaroGarcia</dc:creator>
      <dc:date>2013-10-21T12:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178534#M4609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: kenbuja&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's an example of a tool where a command button is enabled if there are two registry keys.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the Config.esriaddinx&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; &amp;lt;AddIn language="CLR" library="MPA_SPARC.dll" namespace="MPA_SPARC"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ArcMap&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Commands&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Button id="Biogeography_Branch_MPA_SPARC_btnAnalyze" class="btnAnalyze" message="Start the main Analysis tool" caption="Analyze" tip="Analyze" category="Biogeography Branch Add-In Controls" image="Images\btnAnalyze.png" &lt;SPAN style="color:#ff0000;"&gt;onDemand="false"&lt;/SPAN&gt; /&amp;gt;

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and this is the code for the command&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Class btnAnalyze
&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits ESRI.ArcGIS.Desktop.AddIns.Button

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New()

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Overrides Sub OnClick()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the click task

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Overrides Sub OnUpdate()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim KeyExist As Boolean

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyExist = (My.Computer.Registry.GetValue("HKEY_CURRENT_USER\SOFTWARE\Biogeography Branch\SPARC", "MPA", Nothing) IsNot Nothing)&amp;nbsp; And
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (My.Computer.Registry.GetValue("HKEY_CURRENT_USER\SOFTWARE\Biogeography Branch\SPARC", "Resources", Nothing) IsNot Nothing)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = (My.ArcMap.Application IsNot Nothing) And KeyExist

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

End Class&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:09:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178534#M4609</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T09:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178535#M4610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I inserted, onDemand ="false" statement in the button of the config again, which caused ArcMap to crash.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I getting the same results as the previous time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;lt;ESRI.Configuration xmlns="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.esri.com/Desktop/AddIns" rel="nofollow" target="_blank"&gt;http://schemas.esri.com/Desktop/AddIns&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Name&amp;gt;OKC_FixArcs_Cmd&amp;lt;/Name&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;AddInID&amp;gt;{2b2b3fd4-6c5e-45b6-b378-232e81da046f}&amp;lt;/AddInID&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Description&amp;gt;"Smooths the arc by inserting vertices using the density method only on polyline and polygon feature classes"&amp;lt;/Description&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Version&amp;gt;1.0&amp;lt;/Version&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Image&amp;gt;Images\OKC_FixArcs_Cmd.png&amp;lt;/Image&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Author&amp;gt;Genaro L. Garcia, Jr.&amp;lt;/Author&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Company&amp;gt;City of Oklahoma City&amp;lt;/Company&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Date&amp;gt;10/15/2013&amp;lt;/Date&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;Targets&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Target name="Desktop" version="10.0" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/Targets&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;AddIn language="CLR" library="OKC_FixArcs_Cmd.dll" namespace="OKC_FixArcs_Cmd"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ArcMap&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Commands&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Button&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id="City_of_Oklahoma_OKC_FixArcs_Cmd_OKC_FixArcs" class="OKC_FixArcs" tip="Fix Arcs" message="Smooths the arc by inserting vertices using the density method only on polyline and polygon feature classes" caption="Fix Arcs Cmd" category="Add-In Controls" image="Images\OKC_FixArcs_Cmd.png" onDemand="false /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Commands&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ArcMap&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/AddIn&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ESRI.Configuration&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 19:02:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178535#M4610</guid>
      <dc:creator>GenaroGarcia</dc:creator>
      <dc:date>2013-10-21T19:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178536#M4611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: kenbuja&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have the quotes closed correctly? Your line finishes with this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt; onDemand="false /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which is missing the final quote&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt; onDemand="false&lt;SPAN style="color:#ff0000;"&gt;"&lt;/SPAN&gt; /&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 19:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178536#M4611</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-10-21T19:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178537#M4612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, Ken, I fix that problem, onDemand = "false".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Still crashes ArcMap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At this point, I wrote code to check to see the edit status in order to us the command tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 13:52:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178537#M4612</guid>
      <dc:creator>GenaroGarcia</dc:creator>
      <dc:date>2013-10-22T13:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178538#M4613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: kenbuja&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's how I have one button in an addin that only is enabled when the editor has started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Protected Overrides Sub OnUpdate()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Enabled = My.ArcMap.Editor.EditState &amp;lt;&amp;gt; ESRI.ArcGIS.Editor.esriEditState.esriStateNotEditing

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The next thing to do is to put Try..Catch blocks in your code to see where and why it is crashing&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178538#M4613</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T09:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Disable a command button within an Add-In</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178539#M4614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Late in the game I know, I did however just hit this issue and resolved it by using&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;onDemand="0" instead of&amp;nbsp;&lt;SPAN&gt;onDemand="false"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2019 18:57:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/disable-a-command-button-within-an-add-in/m-p/178539#M4614</guid>
      <dc:creator>JeraldAllen</dc:creator>
      <dc:date>2019-04-05T18:57:33Z</dc:date>
    </item>
  </channel>
</rss>

