<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mystalia Studios &#187; keypress</title>
	<atom:link href="http://www.mystalia.net/tag/keypress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mystalia.net</link>
	<description>Coding Studio</description>
	<lastBuildDate>Fri, 19 Mar 2010 01:22:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>C# Textbox and AutoCompleteMode Conflicts with KeyPress.</title>
		<link>http://www.mystalia.net/2008/07/c-textbox-and-autocompletemode-conflicts-with-keypress/</link>
		<comments>http://www.mystalia.net/2008/07/c-textbox-and-autocompletemode-conflicts-with-keypress/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 14:07:13 +0000</pubDate>
		<dc:creator>Mystalia</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[keydown]]></category>
		<category><![CDATA[keypress]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[textbox]]></category>

		<guid isPermaLink="false">http://www.mystalia.net/?p=20</guid>
		<description><![CDATA[Ok, personally I was using a textbox and when you pressed &#8220;Enter&#8221; it would complete a task, BUT I also wanted the textbox to be autocompletive (if that&#8217;s a valid term). When I actually went to test it all out I found that instead of running the Keypress event, it just highlighted the text and [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, personally I was using a textbox and when you pressed &#8220;Enter&#8221; it would complete a task, BUT I also wanted the textbox to be autocompletive (if that&#8217;s a valid term).</p>
<p>When I actually went to test it all out I found that instead of running the Keypress event, it just highlighted the text and did nothing else&#8230; Googled to find there is no valid reason why, but there is a work around, and it&#8217;s simple.</p>
<p>Abandon KeyPress and use the KeyDown function, setup your keydown event correctly, and it will work.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> textBox1_KeyDown<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, KeyEventArgs e<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">KeyCode</span> <span style="color: #008000;">==</span> Keys<span style="color: #008000;">.</span><span style="color: #0000FF;">Enter</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.mystalia.net/2008/07/c-textbox-and-autocompletemode-conflicts-with-keypress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
