<?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 after OnKillFocus event, determine which control has the focus in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/after-onkillfocus-event-determine-which-control/m-p/409414#M2983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to determine which control on a form currently has the focus?&amp;nbsp; I see how to SetFocus for a particular control, but there does not appear to be either a HasFocus or an IsActive property for the form controls.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My form has two controls that hold the same information: an Edit control where the user to type anything and a ListBox for selecting from a series of common defaults.&amp;nbsp; Whenever that information changes (when the change is complete, not halfway through the typed word), I want my vbscript code to update the other control to match, and update various other controls and related DBF tables.&amp;nbsp; For the listbox I use the OnSelChange event, and I had been trying to use the OnKillFocus event for the textbox.&amp;nbsp; However, if they user types something new in the Edit control and then clicks on a value in the ListBox, the OnKillFocus event (of course) runs before OnSelChange.&amp;nbsp; Say user types "Drain#X" in the Edit control, then clicks on "Drain#Y" in the ListBox...&amp;nbsp; The user would expect for "Drain#Y" to be the current value but "Drain#X" is used instead.&amp;nbsp; In fact, "Drain#X" (the typed value) stays in the Edit control; the ListBox control now has the focus but no value is currently selected (waving the mouse up and down as I test this on my desktop causes the list to scroll).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I could check within the OnKillFocus event's code whether the listbox is the new active control, then I could probably stop the update process before it completes.&amp;nbsp; But I don't see a way of doing this.&amp;nbsp; I suppose I will have to use a work around, adding OnSetFocus events to all form controls except the listbox, with code to check whether the textbox value differs from the listbox.&amp;nbsp; But that will be rather tedious and I'm hoping for a simpler solution.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 May 2013 17:03:06 GMT</pubDate>
    <dc:creator>SuzanneAngelo</dc:creator>
    <dc:date>2013-05-15T17:03:06Z</dc:date>
    <item>
      <title>after OnKillFocus event, determine which control has the focus</title>
      <link>https://community.esri.com/t5/arcpad-questions/after-onkillfocus-event-determine-which-control/m-p/409414#M2983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to determine which control on a form currently has the focus?&amp;nbsp; I see how to SetFocus for a particular control, but there does not appear to be either a HasFocus or an IsActive property for the form controls.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My form has two controls that hold the same information: an Edit control where the user to type anything and a ListBox for selecting from a series of common defaults.&amp;nbsp; Whenever that information changes (when the change is complete, not halfway through the typed word), I want my vbscript code to update the other control to match, and update various other controls and related DBF tables.&amp;nbsp; For the listbox I use the OnSelChange event, and I had been trying to use the OnKillFocus event for the textbox.&amp;nbsp; However, if they user types something new in the Edit control and then clicks on a value in the ListBox, the OnKillFocus event (of course) runs before OnSelChange.&amp;nbsp; Say user types "Drain#X" in the Edit control, then clicks on "Drain#Y" in the ListBox...&amp;nbsp; The user would expect for "Drain#Y" to be the current value but "Drain#X" is used instead.&amp;nbsp; In fact, "Drain#X" (the typed value) stays in the Edit control; the ListBox control now has the focus but no value is currently selected (waving the mouse up and down as I test this on my desktop causes the list to scroll).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I could check within the OnKillFocus event's code whether the listbox is the new active control, then I could probably stop the update process before it completes.&amp;nbsp; But I don't see a way of doing this.&amp;nbsp; I suppose I will have to use a work around, adding OnSetFocus events to all form controls except the listbox, with code to check whether the textbox value differs from the listbox.&amp;nbsp; But that will be rather tedious and I'm hoping for a simpler solution.&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2013 17:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/after-onkillfocus-event-determine-which-control/m-p/409414#M2983</guid>
      <dc:creator>SuzanneAngelo</dc:creator>
      <dc:date>2013-05-15T17:03:06Z</dc:date>
    </item>
  </channel>
</rss>

