<?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: Capture [Enter] Keystroke from MaskedTextbox on UserControl in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181260#M4701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just a follow up with the solution to this issue...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kirk, thanks again for the comments.&amp;nbsp; Before I had set off to pursue the info you provided, I was thinking this had to be a much more basic problem that has a very simple solution.&amp;nbsp; It does.&amp;nbsp; So, I tried one other thing (not sure why I missed it before):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The KeyUp Event of the Masked TextBox control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For whatever reason, the KeyPress and KeyDown events do not recognize the Return/Enter key --- they DO fire, but just not for THAT particular key stroke.&amp;nbsp; So this issue is resolved quite simply by this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Private Sub txtPIDSearch_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtPIDSearch.KeyUp
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If e.KeyValue = Keys.Enter 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; 'do something
&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; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(ex.ToString)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your input, I appreciate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take Care,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;j&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the tip, Kirk...&lt;BR /&gt;&lt;BR /&gt;I'll continue down this route as this is the only info I've been able to acquire regarding this!&lt;BR /&gt;&lt;BR /&gt;Thank You!!!&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:16:03 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2021-12-11T09:16:03Z</dc:date>
    <item>
      <title>Capture [Enter] Keystroke from MaskedTextbox on UserControl</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181255#M4696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As the title suggests, I implemented a UserControl that contains button and Masked Textbox controls that is added to ArcMap as a ToolBar.&amp;nbsp; All works fine except for an issue that would not be a problem IF the Masked Textbox was on a regular WindowsForm.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is that I cannot seem to capture the key stroke of the [Enter] key of the KeyDown event of the Masked Textbox.&amp;nbsp; I have no problem getting anyother key, but the KeyDown event doesn't even pickup the [Enter] key.&amp;nbsp; As I mentioned, if this control was on a regular windows form it wouldn't be a problem, but this is a control placed on a UserControl with no windows forms in sight.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the user types into the Masked Textbox and hits the [Enter] key, I'd like to 'do something.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 17:08:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181255#M4696</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2010-04-30T17:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Capture [Enter] Keystroke from MaskedTextbox on UserControl</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181256#M4697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Bump TTT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have any suggestions?&amp;nbsp; Even google searches have produced very limited results on resolving this issue.&amp;nbsp; I have found one thing, "esriKeyIntercept", but I have no idea where to implement this in regards to my UserControl.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again, I am trying to capture the [Enter] Keystroke after the user types into a MaskedTextbox located on a UserControl that is added to ArcMap.&amp;nbsp; The UserControl acts as a Toolbar on the menu area, and all items do work as expected. I just cannot seem to capture any time the [Enter]/Return key is hit!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any input on this is greatly appreciated as I've run out of places to look for answers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;j&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 15:58:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181256#M4697</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2010-05-06T15:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Capture [Enter] Keystroke from MaskedTextbox on UserControl</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181257#M4698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ttt&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone have comments regarding this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 12:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181257#M4698</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2010-05-12T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Capture [Enter] Keystroke from MaskedTextbox on UserControl</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181258#M4699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using Spy++, find out if its the parent, grandparent, or greatgrandparent ... that is getting the Enter key press message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once you know that, write a class that uses IToolControl.hwnd to find the ancestor and subclass it to capture the&amp;nbsp; message before it has a chance to block it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.microsoft.com/kb/815775"&gt;http://support.microsoft.com/kb/815775&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 17:31:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181258#M4699</guid>
      <dc:creator>KirkKuykendall</dc:creator>
      <dc:date>2010-05-12T17:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Capture [Enter] Keystroke from MaskedTextbox on UserControl</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181259#M4700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Using Spy++, find out if its the parent, grandparent, or greatgrandparent ... that is getting the Enter key press message.&lt;BR /&gt;&lt;BR /&gt;Once you know that, write a class that uses IToolControl.hwnd to find the ancestor and subclass it to capture the&amp;nbsp; message before it has a chance to block it.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.microsoft.com/kb/815775"&gt;http://support.microsoft.com/kb/815775&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the tip, Kirk...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll continue down this route as this is the only info I've been able to acquire regarding this!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank You!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 May 2010 18:37:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181259#M4700</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2010-05-12T18:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Capture [Enter] Keystroke from MaskedTextbox on UserControl</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181260#M4701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just a follow up with the solution to this issue...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kirk, thanks again for the comments.&amp;nbsp; Before I had set off to pursue the info you provided, I was thinking this had to be a much more basic problem that has a very simple solution.&amp;nbsp; It does.&amp;nbsp; So, I tried one other thing (not sure why I missed it before):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The KeyUp Event of the Masked TextBox control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For whatever reason, the KeyPress and KeyDown events do not recognize the Return/Enter key --- they DO fire, but just not for THAT particular key stroke.&amp;nbsp; So this issue is resolved quite simply by this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Private Sub txtPIDSearch_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtPIDSearch.KeyUp
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If e.KeyValue = Keys.Enter 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; 'do something
&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; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(ex.ToString)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your input, I appreciate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take Care,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;j&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for the tip, Kirk...&lt;BR /&gt;&lt;BR /&gt;I'll continue down this route as this is the only info I've been able to acquire regarding this!&lt;BR /&gt;&lt;BR /&gt;Thank You!!!&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:16:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/capture-enter-keystroke-from-maskedtextbox-on/m-p/181260#M4701</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T09:16:03Z</dc:date>
    </item>
  </channel>
</rss>

