<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming with .NET - General</title><link>http://forums.silverlight.net/forums/17.aspx</link><description>General discussions around authoring Silverlight .NET applications.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: KeyDown event throws an exception when MessageBox.Show(e.Key.ToString()) is called</title><link>http://forums.silverlight.net/forums/thread/232008.aspx</link><pubDate>Thu, 11 Jun 2009 10:46:12 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:232008</guid><dc:creator>Jonathan Shen – MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/232008.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=232008</wfw:commentRss><description>&lt;p&gt;Hi Grey Matter,&lt;/p&gt;
&lt;p&gt;This is a known issue and has been fixed in Silverlight 3.&amp;nbsp;&amp;nbsp; Currently, the workaround is to do it like this.&lt;/p&gt;&lt;pre class="coloredcode"&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; myTextBox_KeyDown(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, KeyEventArgs e)
        {
            Dispatcher.BeginInvoke(()=&amp;gt;{
                MessageBox.Show(e.Key.ToString());
            });
        }&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jonathan&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: KeyDown event throws an exception when MessageBox.Show(e.Key.ToString()) is called</title><link>http://forums.silverlight.net/forums/thread/230365.aspx</link><pubDate>Sun, 07 Jun 2009 23:31:28 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:230365</guid><dc:creator>Grey Matter</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/230365.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=230365</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thank for your explanation, but I still have some doubts:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;If any other thread (event) tries to display MessageBox at the same time why can&amp;#39;t I catch it at my breakpoint?&lt;/p&gt;&lt;p&gt;It&amp;#39;s caught only once and sometimes drops on it. By the way, my Firefox drops too.&lt;/p&gt;&lt;p&gt;Then I added a TextBlock to check a chance of multiple KeyDown events and was putting every got key to the TextBlock&amp;#39;s content. &lt;/p&gt;&lt;p&gt;But no multiple events occurred.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: KeyDown event throws an exception when MessageBox.Show(e.Key.ToString()) is called</title><link>http://forums.silverlight.net/forums/thread/230238.aspx</link><pubDate>Sun, 07 Jun 2009 12:30:34 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:230238</guid><dc:creator>varshavmane</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/230238.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=230238</wfw:commentRss><description>&lt;p&gt;Check this link:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.vertigo.com/personal/keithc/Blog/archive/2008/12/02/keydown-and-messagebox-dont-mix-well-in-silverlight.aspx"&gt;http://blogs.vertigo.com/personal/keithc/Blog/archive/2008/12/02/keydown-and-messagebox-dont-mix-well-in-silverlight.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Its will answer your post. Hope it helps you &lt;img src="http://silverlight.net/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;</description></item><item><title>KeyDown event throws an exception when MessageBox.Show(e.Key.ToString()) is called</title><link>http://forums.silverlight.net/forums/thread/230143.aspx</link><pubDate>Sat, 06 Jun 2009 22:43:35 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:230143</guid><dc:creator>Grey Matter</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/230143.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=230143</wfw:commentRss><description>&lt;p&gt;The TextBox&amp;#39;s event:&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;private void&lt;/span&gt; TextBox_KeyDown(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, KeyEventArgs e)&lt;br /&gt;{&lt;br /&gt;    MessageBox.Show(e.Key.ToString());&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;throws an exception on any key pressed just except the first one. &lt;/pre&gt;&lt;pre class="coloredcode"&gt;It doesn&amp;#39;t happen at all on the KeyUp event with the same code within.&lt;/pre&gt;&lt;pre class="coloredcode"&gt;What does it mean? &lt;br /&gt;&lt;/pre&gt;</description></item></channel></rss>