textbox gotfocus wpf code example
Example 1: textbox gotfocus wpf
private void tb_GotFocus(object sender, RoutedEventArgs e)
{
TextBox tb = sender as TextBox;
if (tb != null) {
tb.SelectAll(); //select all text in TextBox
}
}
Example 2: textbox gotfocus wpf
<TextBox Name="tb"
GotFocus="tb_GotFocus" />