How Do I Give a Textbox Focus in Silverlight?

I found this on silverlight.net, and was able to get it to work for me by adding a call to System.Windows.Browser.HtmlPage.Plugin.Focus() prior to calling RegularTextBox.Focus():

   private void UserControl_Loaded(object sender, RoutedEventArgs e)
   {        
      System.Windows.Browser.HtmlPage.Plugin.Focus();
      RegularTextBox.Focus();
   }

Leave a Comment