<?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: Why is my form remembering? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174191#M4518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When I have a form with required parameters, I disable the OK button until everything required is fill out. Each control that is required runs a subroutine on its Click (or KeyPress or Changed etc) event that checks if all requirements have been met. If so, the button is enabled. Here's an example&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a great idea...thanks for the information!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jan 2014 19:53:26 GMT</pubDate>
    <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
    <dc:date>2014-01-22T19:53:26Z</dc:date>
    <item>
      <title>Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174179#M4506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an Add-In where the user browses to a FGDB (returns a string of the FGDB path and adds it to a label on the form). I have another label that has the string of a file path, and then 2 combo boxes (choose a layer).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The user is unable to proceed unless all parameters are filled out, so if they navigate to a FGDB, but forget to add the required layers, they close the form, add the data, and re-open the form.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: "Close the form" = stop the Add-in, add the data, then re-launch the add-in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, my form is remembering the file paths (they're also stored in a public string variable). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is, what am I doing incorrectly about closing the form and not disposing (?) of all the variables. The combo boxes are cleared, but the variables and the labels which store the paths remain intact.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code for the form:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Public Class frmProgress&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub btnBrowseGPX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseGPX.Click &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call Procedures.GetGPXPath() &amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub btnBrowseGDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseGDB.Click &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call Procedures.GetGDBPath() &amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Close the form, but continue with the code in Procedures. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Hide() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bContinue = True &amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Exit the Do loop in Procedures using the continue boolean and close the form. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bContinue = False &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Close() &amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub frmProgress_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If e.CloseReason = Windows.Forms.CloseReason.UserClosing Then &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bContinue = False &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Cancel = False &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub End Class&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The program has a Do loop so that if they attempt to proceed without filling out the parameters, it will get mad, but keep the form open. Thus the reason for the Me.FormClosing handle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyways, I'm going to review some other Add-Ins I have which have similar functionality, I'm sure it's just a small oversight, but if you can think of anything of the bat, that would be greatly appreciated!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 18:20:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174179#M4506</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2014-01-22T18:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174180#M4507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What does "stop the Add-in" mean?&amp;nbsp; Are you closing out of ArcMap?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 18:33:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174180#M4507</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2014-01-22T18:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174181#M4508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Once they hit OK on the form (assuming all parameters have been filled out), the program does a whole bunch of stuff (irrelevant for now).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If they hit cancel or the 'X' button, the intention is to quit out of the Add-In (don't proceed with aforementioned stuff). ArcMap would remain open in this case. The issue is that, if they click the Add-In again, I want it to be a clean slate. Since it's not, that means my code is somehow doing something it shouldn't be...e.g. remembering variables.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 18:43:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174181#M4508</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2014-01-22T18:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174182#M4509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Once you fire the event of your add-in that creates your intance variables, unless you are de-referencing them or resetting them back to their default values at some point along the way, you will get the same values you entered before when the form is re-opened.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You have a button on your form that closes your form and you have a form closing event as well.&amp;nbsp; In both of those places, you need to set your string variables back to an empty string, or have both of those places call a procedure that does that for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 18:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174182#M4509</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2014-01-22T18:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174183#M4510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the helpful reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That makes some sense to me. That behaviour wasn't intentional, but I don't see it as being bad (at least in this particular case)...is that bad practice that the variables are remaining as is?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an additional question as well. When the form closes (either cancel or 'X') it should be setting bContinue = False. Shouldn't this exiting of the main Subroutine call the garbage collection and dereference any variables? Mainly wondering if I should "fix" the fact that the variables aren't being dereferenced.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code that the Add-In button click runs, if it helps make sense of my problem: &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Declare and initialize variables.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pUID As IUID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer As ILayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pEnumLayer As IEnumLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMxDoc = My.ArcMap.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMap = pMxDoc.FocusMap

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set UID to retrieve IFeatureLayer which can be QI'd to ILayer.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pUID = New UID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pUID.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get list of all feature layers in the map. True means recursive so it will return all feature layers in the table of contents.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set iterator to the front of the list.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnumLayer = pMap.Layers(pUID, True)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEnumLayer.Reset()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get first layer in list, and QI to ILayer (to make use of the .Name property).
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pLayer = pEnumLayer.Next

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Clear the combo boxes in case the user has already attempted to proceed without filling all parameters out.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frmProgress.cbTWPLayer.Items.Clear()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frmProgress.cbLSDLayer.Items.Clear()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Iterate through layers to populate combo box list. 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do Until pLayer Is Nothing
&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;&amp;nbsp;&amp;nbsp; frmProgress.cbLSDLayer.Items.Add(pLayer.Name)
&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;&amp;nbsp;&amp;nbsp; frmProgress.cbTWPLayer.Items.Add(pLayer.Name)
&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;&amp;nbsp;&amp;nbsp; pLayer = pEnumLayer.Next()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Display the form.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frmProgress.ShowDialog()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' OK and Cancel buttons determine whether or not to proceed.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not Procedures.bContinue Then
&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;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&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;&amp;nbsp;&amp;nbsp; ' Store information from combo boxes.
&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;&amp;nbsp;&amp;nbsp; sLSD = frmProgress.cbLSDLayer.Text
&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;&amp;nbsp;&amp;nbsp; sTWP = frmProgress.cbTWPLayer.Text

&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;&amp;nbsp;&amp;nbsp; If sGPXPathPublic = "" Or sGDBPathPublic = "" Or sLSD = "" Or sTWP = "" Then
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox("You must fill out all parameters.")
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Continue Do
&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;&amp;nbsp;&amp;nbsp; Else
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call Procedures.Main(frmProgress)
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&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;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:00:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174183#M4510</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2021-12-11T09:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174184#M4511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the helpful reply.&lt;BR /&gt;That makes some sense to me. That behaviour wasn't intentional, but I don't see it as being bad (at least in this particular case)...is that bad practice that the variables are remaining as is?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Bad practice? It's your application, only you know what the flow is supposed to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I have an additional question as well. When the form closes (either cancel or 'X') it should be setting bContinue = False. Shouldn't this exiting of the main Subroutine call the garbage collection and dereference any variables? Mainly wondering if I should "fix" the fact that the variables aren't being dereferenced.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure I understand why you have an outer do loop.&amp;nbsp; You are not looping.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:06:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174184#M4511</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2014-01-22T19:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174185#M4512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fair answer, in this case I don't think it's a bad thing. In the bigger picture, because it wasn't intended, I'm not 100% happy with it, but that's ok for now. At least I've been given a good explanation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the Do Loop, it's purpose is to prevent the form from closing when the user hits 'OK' without having filled out the required parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Without it, they're warned that they didn't fill everything out, but because the OK button hides the form (with the expectation that it will proceed with the rest of the code), they have to re-run the Add-In. It's not required, but I like the idea that if they forget 1 thing, they don't have to go back and re-do everything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thus the reason as well to handle form closing event. If they hit cancel or 'X' I know they don't want to continue, but the code doesn't unless I tell it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My knowledge is rather limited, so I may be misunderstanding things, but that's the reason I have those in place.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:25:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174185#M4512</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2014-01-22T19:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174186#M4513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Fair answer, in this case I don't think it's a bad thing. In the bigger picture, because it wasn't intended, I'm not 100% happy with it, but that's ok for now. At least I've been given a good explanation.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;It's fine with me.&amp;nbsp; I have certain forms that leave the position of sliders where they were so the user can see where they left off.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;As for the Do Loop, it's purpose is to prevent the form from closing when the user hits 'OK' without having filled out the required parameters.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I hear what you are saying, but you don't need a do loop for that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Without it, they're warned that they didn't fill everything out, but because the OK button hides the form (with the expectation that it will proceed with the rest of the code), they have to re-run the Add-In. It's not required, but I like the idea that if they forget 1 thing, they don't have to go back and re-do everything.&lt;BR /&gt;&lt;BR /&gt;Thus the reason as well to handle form closing event. If they hit cancel or 'X' I know they don't want to continue, but the code doesn't unless I tell it.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Would you be willing to post a screen shot of your form?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:42:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174186#M4513</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2014-01-22T19:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174187#M4514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Interesting...I haven't found out how to accomplish what I want without a Do Loop. I'll have to look into that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Absolutely, screen shot is attached.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Standard form, nothing too fancy (one hidden label to be used later in the code, and 2 empty labels for the paths).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if you want to see how it looks with data (though I'm sure you can imagine), or if you want any other info!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:47:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174187#M4514</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2014-01-22T19:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174188#M4515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;which components are required to be completed before the form closes?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:50:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174188#M4515</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2014-01-22T19:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174189#M4516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I have a form with required parameters, I disable the OK button until everything required is fill out. Each control that is required runs a subroutine on its Click (or KeyPress or Changed etc) event that checks if all requirements have been met. If so, the button is enabled. Here's an example&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; Private Sub EnableRun()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If cboLayers.Text &amp;lt;&amp;gt; "" Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If chkCreate.Checked Then
&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;&amp;nbsp;&amp;nbsp; If txtIntersection.Text &amp;lt;&amp;gt; "" Then
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btnOK.Enabled = True
&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;&amp;nbsp;&amp;nbsp; Else
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btnOK.Enabled = False
&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;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&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;&amp;nbsp;&amp;nbsp; btnOK.Enabled = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btnOK.Enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub chkCreate_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkCreate.CheckedChanged
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'do something 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnableRun()

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub txtIntersection_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtIntersection.TextChanged

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'do something 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EnableRun()

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:00:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174189#M4516</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T09:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174190#M4517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All four components are required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;They pick the output geodatabase, choose the two layers as required, and pick a .gpx file, then hit OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The rest of code runs without user input. I wanted to get it all out of the way in one area.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:52:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174190#M4517</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2014-01-22T19:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174191#M4518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When I have a form with required parameters, I disable the OK button until everything required is fill out. Each control that is required runs a subroutine on its Click (or KeyPress or Changed etc) event that checks if all requirements have been met. If so, the button is enabled. Here's an example&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a great idea...thanks for the information!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:53:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174191#M4518</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2014-01-22T19:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174192#M4519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Like I said, and like Mr. Buja shows with his example, your Ok and window closing events can call a routine that checks whether your parameters have been filled out.&amp;nbsp; filled out vs filled out right is a different story.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 19:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174192#M4519</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2014-01-22T19:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my form remembering?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174193#M4520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great, thanks very much guys. Appreciate the information!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2014 20:01:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-my-form-remembering/m-p/174193#M4520</guid>
      <dc:creator>deleted-user-VeC5jUIlNXtq</dc:creator>
      <dc:date>2014-01-22T20:01:45Z</dc:date>
    </item>
  </channel>
</rss>

