Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set focus to TextBox

In my WindowsPhone application I have a Text Box that needs to receive focus at a given time. What I've tried so far:

textBox1.Focus();

textBox1.UpdateLayout();
textBox1.Focus();

textBox1.IsTabStop = true;
textBox1.UpdateLayout();
textBox1.Focus();

textBox1.IsTabStop = true;
textBox1.Focus();

Nothing seems to work. In the Emulator, when the Focus() method is called, the keyboard starts to rise, but then crashes back. The TextBox has IsTabStop set to true in the properties.

like image 931
Adrian Marinica Avatar asked Dec 04 '22 21:12

Adrian Marinica


1 Answers

Does this help?

this.ActiveControl = textBox1;

like image 190
Torre Lasley Avatar answered Dec 16 '22 21:12

Torre Lasley