Shiny Silverlights

...Another Silverlight MVP blog

caretIndex

...now browsing by tag

 
 

WP7 caretIndex

Thursday, June 2nd, 2011

In a recent project of mine, I needed to programmatically change the position of the caret in TextBox. Sadly I realized that Windows Phone 7 TextBox doesn’t have the caretIndex property. No worries, you can achieve the same with TextBox.Select().

To move carret to the end of text in TextBox, just use:

textBox.Select(textBox.Text.Length, 0);