I have multiple text boxes on a silverlight page. How can I make one of them active so that I will not have to click it to be able to type into it.
+1
A:
You could try
textBox1.Focus();
This tries to bring the focus over your textbox.
EDIT: I assume that you want to select your textbox when the page is loaded. In this situation you nead to bring the focus to the silverlight plug-in first and after that to call Focus() method of your textbox.
Here a way to do this:
System.Windows.Browser.HtmlPage.Plugin.Focus();
Koynov
2010-07-09 05:55:42
I already tried that. I do textBox1.Focus() and I run the solution, if I start typing nothing happens... so I still have to click on the textbox
Andrei T. Ursan
2010-07-09 06:01:45
You could check the update of my answer. HTH
Koynov
2010-07-09 06:28:26
In IE works, but in chrome it doesn't. I think this is because silverlight has a little bit of support problems with chrome. dunno.Anyway I'm marking your answer as the solution.Thank you!
Andrei T. Ursan
2010-07-09 06:47:03