<?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: Re: Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/288922.aspx</link><pubDate>Thu, 17 Sep 2009 10:47:25 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:288922</guid><dc:creator>GearWorld</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/288922.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=288922</wfw:commentRss><description>&lt;p&gt;Thanx to whom ?&lt;br /&gt;What works ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/287334.aspx</link><pubDate>Tue, 15 Sep 2009 05:26:20 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:287334</guid><dc:creator>lonelyprince</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/287334.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=287334</wfw:commentRss><description>thanks, it works</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/281505.aspx</link><pubDate>Thu, 03 Sep 2009 22:53:04 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:281505</guid><dc:creator>GearWorld</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/281505.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=281505</wfw:commentRss><description>&lt;p&gt;That&amp;#39;s right DNA :)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/281317.aspx</link><pubDate>Thu, 03 Sep 2009 17:16:22 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:281317</guid><dc:creator>MisinformedDNA</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/281317.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=281317</wfw:commentRss><description>&lt;p&gt;My code above shows exactly what I am doing, except I swapped the two lines. Of course this is the main page, there is still the frame that has to load.&lt;/p&gt;
&lt;p&gt;According to you, you are getting an invisible cursor at times. That tells me that you don&amp;#39;t have the final solution yet either.&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/281013.aspx</link><pubDate>Thu, 03 Sep 2009 09:45:51 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:281013</guid><dc:creator>GearWorld</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/281013.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=281013</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/silverlight/images/icon-quote.gif"&gt; &lt;strong&gt;MisinformedDNA:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;I thought the invisibleness was being caused by the VisualState. How do I know if VisualState is the last thing going on in the UI thread? The GoToState call is happening when the MainPage&amp;#39;s&amp;nbsp;Loaded event is called.&lt;/p&gt;
&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Is it the very last thing you do in your Loaded event ?&lt;br /&gt;Any Call back after ?&lt;/p&gt;
&lt;p&gt;It must be the very last line of code you do in the Loaded event.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/280724.aspx</link><pubDate>Wed, 02 Sep 2009 20:57:28 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:280724</guid><dc:creator>MisinformedDNA</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/280724.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=280724</wfw:commentRss><description>&lt;p&gt;Clarification: Focus works 100% of the time, but an invisible cursor is a big problem.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m actually using an AutoCompleteBox, so when a user types a letter and the autocomplete comes up, it&amp;#39;s impossible to tell which characters I types and which characters are part of the auto complete.&lt;/p&gt;
&lt;p&gt;I thought the invisibleness was being caused by the VisualState. How do I know if VisualState is the last thing going on in the UI thread? The GoToState call is happening when the MainPage&amp;#39;s&amp;nbsp;Loaded event is called.&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/280641.aspx</link><pubDate>Wed, 02 Sep 2009 18:51:50 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:280641</guid><dc:creator>GearWorld</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/280641.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=280641</wfw:commentRss><description>&lt;p&gt;Are you sure your VisualState is the last thing going on by the UI Thread ?&lt;br /&gt;IF so, I can tell you that mine works 99% fine the 1% it&amp;#39;s the cursor seems invisible but the focus is in the textbox at least.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Oh I just thing about something,&amp;nbsp; Maybe the Easying is making just a bit more after the storyboard and this is why my cursor vanishes&lt;br /&gt;sometimes.&amp;nbsp; Not all the time.&lt;/p&gt;
&lt;p&gt;but this is the only thing not going well.&amp;nbsp; The focus always work tought&lt;br /&gt;Make sure also you use the TextBox.Focus.&amp;nbsp; Not only the htmlPage.Pluing.Focus();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/280558.aspx</link><pubDate>Wed, 02 Sep 2009 15:41:44 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:280558</guid><dc:creator>MisinformedDNA</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/280558.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=280558</wfw:commentRss><description>&lt;p&gt;GearBox, have you gotten it to work 100% of the time? &lt;/p&gt;
&lt;p&gt;I have&amp;nbsp;the following XAML in MainPage.xaml in the Grid element&amp;nbsp;&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&amp;gt;
	&amp;lt;&lt;span class="tag"&gt;VisualStateGroup&lt;/span&gt;&lt;span class="attr"&gt; x:Name=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Startup&amp;quot;&lt;/span&gt;&amp;gt;
		&amp;lt;&lt;span class="tag"&gt;VisualState&lt;/span&gt;&lt;span class="attr"&gt; x:Name=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Intro&amp;quot;&lt;/span&gt;&amp;gt;
			&amp;lt;&lt;span class="tag"&gt;Storyboard&lt;/span&gt;&lt;span class="attr"&gt; Completed=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Intro_Completed&amp;quot;&lt;/span&gt;/&amp;gt;
		&amp;lt;/&lt;span class="tag"&gt;VisualState&lt;/span&gt;&amp;gt;
	&amp;lt;/&lt;span class="tag"&gt;VisualStateGroup&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class="tag"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In MainPage.xaml.cs&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;.Loaded += (s, e) =&amp;gt;
{
    VisualStateManager.GoToState(&lt;span class="kwd"&gt;this&lt;/span&gt;, &lt;span class="st"&gt;&amp;quot;Intro&amp;quot;&lt;/span&gt;, &lt;span class="kwd"&gt;true&lt;/span&gt;);
    HtmlPage.Plugin.Focus();
};
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s still not working 100% of the time. Better, but not fixed yet. Do I need something else?&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/280521.aspx</link><pubDate>Wed, 02 Sep 2009 14:40:47 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:280521</guid><dc:creator>mepfuso</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/280521.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=280521</wfw:commentRss><description>Setting controls&amp;#39; focus on Microsoft platform has always been a problem, I dunno why. It works a lot easier on other platforms. ;-) ... Also the solutions presented here are obviously mere hacks.

The render engine must handle this internally. It must save every call to any .Focus() method of the visual tree in a field, and then, after layouting and other heavy UI work is done, execute the actual focussing for the control that was the last one requesting the focus.</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/280512.aspx</link><pubDate>Wed, 02 Sep 2009 14:23:57 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:280512</guid><dc:creator>GearWorld</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/280512.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=280512</wfw:commentRss><description>&lt;p&gt;This thread : &lt;a href="http://silverlight.net/forums/t/122682.aspx"&gt;http://silverlight.net/forums/t/122682.aspx&lt;/a&gt;&amp;nbsp;helps solve the Focus problem after a VisualState&lt;br /&gt;The idea is to set the Completed Event to the VisualState StoryBoard and in the completed event you wire up you put the focus there.&lt;/p&gt;
&lt;p&gt;Because all the focus problems are always related to the UI thread doing something and until it isn&amp;#39;t finished, focusing is useless.&lt;br /&gt;Focusing will walways work if you&amp;#39;re at the VERY END of anything the UI thread is working on.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/279196.aspx</link><pubDate>Mon, 31 Aug 2009 17:39:40 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:279196</guid><dc:creator>MisinformedDNA</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/279196.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=279196</wfw:commentRss><description>&lt;p&gt;I combined what I read above into the following:&lt;/p&gt;
&lt;p&gt;I put the first line below in my constructor.&amp;nbsp;The purpose of the multiple Dispatcher calls is to delay the focus from happening right away and interfering with the VisualState (as suggested by GearBox).&lt;/p&gt;
&lt;p&gt;The &amp;quot;InitialFocus.Focus()&amp;quot; call represents a call to a Collapsed TextBox and then I switch to the real TextBox that I want focus.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;.Loaded += (s, e) =&amp;gt; Dispatcher.BeginInvoke(() =&amp;gt; Dispatcher.BeginInvoke(GetFocus));

&lt;span class="kwd"&gt;private void&lt;/span&gt; GetFocus()
{
    HtmlPage.Plugin.Focus();
    InitialFocus.Focus();
    SearchBox.Focus();
}
&lt;/pre&gt;&amp;nbsp; 
&lt;p&gt;This seems to work 100% of the time for me and is the best thing I&amp;#39;ve found so far. Thanks for all your help.&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/274346.aspx</link><pubDate>Sun, 23 Aug 2009 11:55:47 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:274346</guid><dc:creator>GearWorld</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/274346.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=274346</wfw:commentRss><description>&lt;p&gt;This problem is hard to pin point.&amp;nbsp; Sometimes it works sometimes not.&amp;nbsp; Here&amp;#39;s a scenario where I&amp;#39;m unable to focus on the TextBox&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;VisualStateManager&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.GoToState(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;OpenAdminPanel&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;br /&gt;System.Windows.Browser.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;HtmlPage&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Plugin.Focus(); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// This didn&amp;#39;t help either.....&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;pbCode.Focus(); &lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// This doesn&amp;#39;t focus on the PasswordBox...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;Seems that when there&amp;#39;s a VisualState in progress at the same time we&amp;#39;re trying to focus, it doesn&amp;#39;t work.&lt;br /&gt;I&amp;#39;ve been looking for an event to tell me when the visual state is completed but I didn&amp;#39;t find any&lt;br /&gt;Seems that focusing on a control works only when Everything else is completed.&amp;nbsp; VERY COMPLETED otherwise&lt;br /&gt;Focusing is useless.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/260911.aspx</link><pubDate>Thu, 30 Jul 2009 22:19:39 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:260911</guid><dc:creator>slavag</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/260911.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=260911</wfw:commentRss><description>&lt;p&gt;Try to change TabIndex:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;PasswordTextBox.TabIndex = 0;&lt;/p&gt;
&lt;p&gt;UserNameTextBox.TabIndex = 1;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.UpdateLayout();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;PasswordTextBox.Focus();&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/215380.aspx</link><pubDate>Mon, 04 May 2009 11:48:05 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:215380</guid><dc:creator>hwsoderlund</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/215380.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=215380</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Try this, see if it works.&amp;nbsp;

&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 0%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Linq;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Net;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Controls;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Documents;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Input;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Media;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Media.Animation;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Shapes;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Threading;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Windows.Browser;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;namespace&lt;/span&gt; SilverlightApplication20&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;partial&lt;/span&gt; &lt;span style="color:blue;"&gt;class&lt;/span&gt; &lt;span&gt;Page4&lt;/span&gt; : &lt;span&gt;UserControl&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; Page4()&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Dispatcher.BeginInvoke(DoFocus);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;private&lt;/span&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; DoFocus()&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span&gt;HtmlPage&lt;/span&gt;.Plugin.Invoke(&lt;span&gt;&amp;quot;focus&amp;quot;&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MyTextBox.Focus();&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: Silverlight 2.0 Textbox focus issue</title><link>http://forums.silverlight.net/forums/thread/215320.aspx</link><pubDate>Mon, 04 May 2009 09:43:32 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:215320</guid><dc:creator>Thomas D</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/215320.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=17&amp;PostID=215320</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/silverlight/images/icon-quote.gif"&gt; &lt;strong&gt;mepfuso:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Servus nach Österreich aus Bayern :-) ... do you try to do that in the constructor, i.e. directly after InitializeComponent()? Maybe focus only works reliably in the Loaded event.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Grüße zurück &lt;img src="http://silverlight.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt; ... I&amp;#39;ve tried to put &lt;i&gt;HtmlPage.Plugin.Focus();&lt;/i&gt; just after &lt;i&gt;InitializeComponent()&lt;/i&gt;, but this didn&amp;#39;t helped either. I can&amp;#39;t set focus to the TextBox directly after loading as it is created at runtime and it&amp;#39;s visibility changes multiple times during interaction with the program (focus should be applied, when the component&amp;#39;s visibility is set to visible). So that didn&amp;#39;t solve the issue unfortunately ...&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>