<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Comments - Enter-Instead-of-Tab - Duncan Mackenzie .NET</title>
  <icon>http://www.duncanmackenzie.net/Content/icons/frog.ico</icon>
  <logo>http://www.duncanmackenzie.net/Content/icons/frog.png</logo>
  <updated>2004-12-15T00:29:00</updated>
  <subtitle type="html">Code/Tea/Etc.</subtitle>
  <id>http://www.duncanmackenzie.net/blog/enter-instead-of-tab/comments/atom</id>
  <link rel="alternate" type="text/html" hreflang="en" href="/blog/enter-instead-of-tab"/>
  <link rel="self" type="application/atom+xml" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab/Comments/ATOM"/>
  <generator uri="http://oxite.net" version="1.0">Oxite</generator>
  <logo>http://www.duncanmackenzie.net/Content/icons/frog.png</logo>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412151229000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412151229000</id>
    <updated>2004-12-15T00:29:00</updated>
    <published>2004-12-15T00:29:00</published>
    <author>
      <name>Mark Christian Aguilar-Barra</name>
    </author>
    <content type="html" xml:lang="en">
      id like to ask if there's a property of the textbox that will restrict the user from inputting letters or numbers? just like in macromedia flash. Im a computer science student from the Philippines. Thank you.&lt;br&gt;&lt;br&gt;here's my email add.= markchristian_aguilar@yahoo.com
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412221036000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412221036000</id>
    <updated>2004-12-22T22:36:00</updated>
    <published>2004-12-22T22:36:00</published>
    <author>
      <name>trac</name>
    </author>
    <content type="html" xml:lang="en">
      yes, then just simply add : SendKeys.Send(&amp;quot;{TAB}&amp;quot;)
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412290456000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412290456000</id>
    <updated>2004-12-29T04:56:00</updated>
    <published>2004-12-29T04:56:00</published>
    <author>
      <name>hany bonyadi</name>
    </author>
    <content type="html" xml:lang="en">
      hello&lt;br&gt;i have problem with DataGrid ,when tablestyle added to it ,Enter processing not work.&lt;br&gt;please help me.&lt;br&gt;
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412290531000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412290531000</id>
    <updated>2004-12-29T17:31:00</updated>
    <published>2004-12-29T17:31:00</published>
    <author>
      <name>nana osei</name>
    </author>
    <content type="html" xml:lang="en">
      id like to ask if there's a property of the textbox that will restrict the user from inputting letters or numbers? just like in macromedia flash. Im a computer science student from ghana&lt;br&gt;&lt;br&gt;email: nanafrifa@yahoo.co.uk
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412291025000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200412291025000</id>
    <updated>2004-12-29T22:25:00</updated>
    <published>2004-12-29T22:25:00</published>
    <author>
      <name>Savager</name>
    </author>
    <content type="html" xml:lang="en">
      Sorry for my English....&lt;br&gt;&lt;br&gt;How set BEEP=OFF When I Press &amp;quot;Enter&amp;quot;. And I Do Me.ProcessTabKey(Not e.Shift)&lt;br&gt;
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501020224000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501020224000</id>
    <updated>2005-01-02T02:24:00</updated>
    <published>2005-01-02T02:24:00</published>
    <author>
      <name>Sajith Poduval</name>
    </author>
    <content type="html" xml:lang="en">
      I want to know how to create autofilling combo boxes by using vb code.
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501090621000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501090621000</id>
    <updated>2005-01-09T06:21:00</updated>
    <published>2005-01-09T06:21:00</published>
    <author>
      <name>Chris Bentley</name>
    </author>
    <content type="html" xml:lang="en">
      I've got the same problem with one of the 'system' sounds occuring when 'Enter' is hit. If I handle the Enter key in OnKeyUp then the beep seems to occur before I enter the event handler. I changed to handling the Enter key within OnKeyDown and there is no beep during the handler - ergo the beep must be occuring within &amp;quot;KeyPressed&amp;quot; I'm tempted to handle KeyPressed as well and just set &amp;quot;handled&amp;quot; to true for Enter, but, I don't think that Enter actually raises a KeyPressed (or did I read the docs incorrectly???)
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501090802000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501090802000</id>
    <updated>2005-01-09T08:02:00</updated>
    <published>2005-01-09T08:02:00</published>
    <author>
      <name>Bud Staniek</name>
    </author>
    <content type="html" xml:lang="en">
      The e.Handled = True statement should suppress the beep.
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501090921000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501090921000</id>
    <updated>2005-01-09T21:21:00</updated>
    <published>2005-01-09T21:21:00</published>
    <author>
      <name>Chris Bentley</name>
    </author>
    <content type="html" xml:lang="en">
      &amp;amp;gt;&amp;amp;gt;&amp;amp;gt; The e.Handled = True statement should suppress the beep.&lt;br&gt;&lt;br&gt;&amp;quot;Should&amp;quot; being the operative word... She's still beeping at me - to the extent that I think I'll turn of the sound programatically and restore it when *I* think it should be on. To make matters worse, when I convert the enter to a tab for a DateTimePicker control I get a different beep - actually it's Windows XP Ding
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501101058000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501101058000</id>
    <updated>2005-01-10T22:58:00</updated>
    <published>2005-01-10T22:58:00</published>
    <author>
      <name>3884273</name>
    </author>
    <content type="html" xml:lang="en">
      j3204-9324-0
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501140104000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501140104000</id>
    <updated>2005-01-14T13:04:00</updated>
    <published>2005-01-14T13:04:00</published>
    <author>
      <name>TJ Neal</name>
    </author>
    <content type="html" xml:lang="en">
      [code]&lt;br&gt;  Private Sub frmFirst_Report_KeyPress _&lt;br&gt;    (ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _&lt;br&gt;      Handles MyBase.KeyPress&lt;br&gt;&lt;br&gt;    If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then&lt;br&gt;      If TypeOf Me.ActiveControl Is TextBox Then&lt;br&gt;        Dim tb As TextBox = DirectCast(Me.ActiveControl, TextBox)&lt;br&gt;        If tb.Multiline AndAlso tb.AcceptsReturn Then&lt;br&gt;          e.Handled = False&lt;br&gt;          Exit Sub&lt;br&gt;        End If&lt;br&gt;      End If&lt;br&gt;      e.Handled = True&lt;br&gt;      Dim oform As Form = Me.FindForm&lt;br&gt;      oform.SelectNextControl(oform.ActiveControl, True, True, True, True)&lt;br&gt;      oform.ActiveControl.Focus()&lt;br&gt;    End If&lt;br&gt;  End Sub&lt;br&gt;[/code]&lt;br&gt;&lt;br&gt;Set your form to KeyPreview and place this routine on the form. You will not get a beep at all and you do not need to access any overrides. (If you prefer SendKey.Send(&amp;quot;{TAB}&amp;quot;) instead of the SelectNextControl it will function also).
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501150818000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200501150818000</id>
    <updated>2005-01-15T08:18:00</updated>
    <published>2005-01-15T08:18:00</published>
    <author>
      <name>harmeet singh</name>
    </author>
    <content type="html" xml:lang="en">
      sss
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200502280516000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200502280516000</id>
    <updated>2005-02-28T17:16:00</updated>
    <published>2005-02-28T17:16:00</published>
    <author>
      <name>Mitra</name>
    </author>
    <content type="html" xml:lang="en">
      I looked around and this is the best I came up with in (C# - Application). I had a username and password field box and i wanted the focus to change on ENTER and not TAB. You have to use this for the KeyDown Event handler&lt;br&gt;&lt;br&gt;private void textBoxUserName_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)&lt;br&gt;		{&lt;br&gt;			if ( e.KeyCode == Keys.Enter )&lt;br&gt;			{&lt;br&gt;				this.GetNextControl( this.textBoxUserName, true ).Focus();&lt;br&gt;			}&lt;br&gt;		}
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200503081155000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200503081155000</id>
    <updated>2005-03-08T11:55:00</updated>
    <published>2005-03-08T11:55:00</published>
    <author>
      <name>sultan mcdoom</name>
    </author>
    <content type="html" xml:lang="en">
      this came from another site and is a much simpler solution&lt;br&gt;Private Sub Form_KeyPress(KeyAscii As Integer)&lt;br&gt;&lt;br&gt;  If KeyAscii = vbKeyReturn Then&lt;br&gt;    KeyAscii = 0&lt;br&gt;    SendKeys &amp;quot;{TAB}&amp;quot;&lt;br&gt;  End If&lt;br&gt;End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;And we all know that by using the KeyAscii = 0 keeps your computer from beeping when you use the Enter key as a Tab.&lt;br&gt;&lt;br&gt;Now the above code works with about 90% of all the controls, however there are some controls where it just does not work, such as the DatePicker control for one.
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200509090506000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200509090506000</id>
    <updated>2005-09-09T17:06:00</updated>
    <published>2005-09-09T17:06:00</published>
    <author>
      <name>Matthew</name>
    </author>
    <content type="html" xml:lang="en">
      The trick is to set e.Handled = true before you do anything else !!!&lt;br&gt;&lt;br&gt;&lt;br&gt;    Private Sub txtSearchValue_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtSearchValue.KeyPress&lt;br&gt;        If sysEnterEqualsTab = True Then&lt;br&gt;            If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then&lt;br&gt;                e.Handled = True&lt;br&gt;                Me.ActiveControl = Me.GetNextControl(txtSearchValue, True)&lt;br&gt;            End If&lt;br&gt;        End If&lt;br&gt;&lt;br&gt;    End Sub&lt;br&gt;
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200604121100000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200604121100000</id>
    <updated>2006-04-12T11:00:00</updated>
    <published>2006-04-12T11:00:00</published>
    <author>
      <name>Corri</name>
    </author>
    <content type="html" xml:lang="en">
      e.Handler = True works for everything but DatePicker Controls.&lt;br&gt;&lt;br&gt;What works for DatePickers?
    </content>
  </entry>
  <entry>
    <title type="html">Enter Instead of Tab</title>
    <link rel="alternate" type="text/html" href="http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200607120233000"/>
    <id>http://www.duncanmackenzie.net/Blog/Enter-Instead-of-Tab#c-200607120233000</id>
    <updated>2006-07-12T02:33:00</updated>
    <published>2006-07-12T02:33:00</published>
    <author>
      <name>parvita</name>
    </author>
    <content type="html" xml:lang="en">
      help me&lt;br&gt;actually  on run time textbox is dishabled using&lt;br&gt;        textbox.enabled=false&lt;br&gt; but there is change in color of textbox e.g. white to gray&lt;br&gt;this is possible with &lt;br&gt;          e.handled= true  on key press event&lt;br&gt;but i want that this dishabling accure with a particular condition or say with in if-else statement&lt;br&gt;&lt;br&gt;&lt;br&gt;plz can u mail me or give solution of this problem with coding&lt;br&gt;i am waiting ur reply&lt;br&gt;thanks
    </content>
  </entry>
</feed>


    <Image height="64" width="64" type="image/png">http://www.duncanmackenzie.net/Content/icons/frog.png</Image>