I have one TextBox. On clicking it, all the contents of the TextBox should be selected. What is the solution for this? The code I have tried is:
<TextBox Name="questionTitle_textBox" Text="Question title" PreviewMouseDown="questionTitle_textBox_PreviewMouseDown"/>
The function questionTitle_textBox_PreviewMouseDown
is defined as
private void questionTitle_textBox_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
questionTitle_textBox.SelectAll();
}