<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-8166852.post3670808941036697609..comments</id><updated>2009-06-10T12:34:25.678-06:00</updated><category term='religion'/><category term='xbox'/><category term='code'/><category term='bandwidth'/><category term='financial software'/><category term='wheel repair'/><category term='driving'/><category term='movies'/><category term='console repair'/><category term='politics'/><title type='text'>Comments on Yakko Warner: I'll handle any key you want... except that one</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.yakkowarner.com/feeds/3670808941036697609/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8166852/3670808941036697609/comments/default'/><link rel='alternate' type='text/html' href='http://www.yakkowarner.com/2009/06/ill-handle-any-key-you-want-except-that.html'/><author><name>Yakko Warner</name><uri>https://profiles.google.com/102705077104052556673</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-n1ELqIITtXM/AAAAAAAAAAI/AAAAAAAACRo/qTx2DZFcbYg/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8166852.post-4322197082107675760</id><published>2009-06-10T12:34:25.678-06:00</published><updated>2009-06-10T12:34:25.678-06:00</updated><title type='text'>Addendum:  Apparently, you should also be aware th...</title><content type='html'>Addendum:  Apparently, you should also be aware that, in a KeyDown event, setting the Handled property of the event args doesn&amp;#39;t actually suppress the key; you also want to set the SuppressKeyPress flag.&lt;br /&gt;&lt;br /&gt;If you want a low-level explanation, &lt;a href="http://blogs.msdn.com/jfoscoding/archive/2006/01/30/519406.aspx" rel="nofollow"&gt;this blog post&lt;/a&gt; (and the comments therein) seem to suggest it has to do with a difference in the way Windows Forms queues and/or handles window messages.&lt;br /&gt;&lt;br /&gt;The high-level view, though:  if you don&amp;#39;t SuppressKeyPress, you may end up wondering why the heck your TextBoxes beep at you when you tab out of them.  Then you might, say, turn your text box into a multi-line to see what happens, notice it&amp;#39;s getting a tab character inserted into its text area, and wonder why Handled isn&amp;#39;t handling it; which, if you&amp;#39;re lucky, will eventually have to stumbling upon the SuppressKeyPress property, which might send you googling for an answer as to why there&amp;#39;s a second property that does what the first one is supposed to, but doesn&amp;#39;t.  (Note the sample code in the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.handled.aspx" rel="nofollow"&gt;MSDN article&lt;/a&gt; that seems to suggest Handled aborts a key press, even though the Remarks suggest it doesn&amp;#39;t, although for the life of me I can&amp;#39;t figure out why it &lt;i&gt;shouldn&amp;#39;t&lt;/i&gt; besides they just made it so.)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8166852/3670808941036697609/comments/default/4322197082107675760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8166852/3670808941036697609/comments/default/4322197082107675760'/><link rel='alternate' type='text/html' href='http://www.yakkowarner.com/2009/06/ill-handle-any-key-you-want-except-that.html?showComment=1244658865678#c4322197082107675760' title=''/><author><name>Yakko Warner</name><uri>http://www.blogger.com/profile/12276550157896918123</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.com/yakkowarner/Ry6C4utWcPI/AAAAAAAAAHk/80O9-nO5fV4/s144/BugBashGP.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.yakkowarner.com/2009/06/ill-handle-any-key-you-want-except-that.html' ref='tag:blogger.com,1999:blog-8166852.post-3670808941036697609' source='http://www.blogger.com/feeds/8166852/posts/default/3670808941036697609' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1703601702'/></entry></feed>
