Good Day,
I am playing with a Silverlight control that has a TextBox and Button. When I click the button (which calls SelectText below), I want to select all the text in the textbox.
Here's my code:
private void SelectText()
{
TextBox tb = this.txtFirstName;
tb.SelectionStart = 0;
tb.SelectionLength = 3;
// tb.Select(0, this.txtFirstName.Text.Trim().Length - 1);
// tb.SelectAll();
// tb.Text = String.Empty;
}
The commented code is what I tried already, but neither is working.
Anyone have suggestions on what I'm doing wrong?
coson