Check out example codes for "textbox gotfocus wpf". It will help you in understanding the concepts better.

Code Example 1

<TextBox Name="tb"
         GotFocus="tb_GotFocus" />

Code Example 2

private void tb_GotFocus(object sender, RoutedEventArgs e)
{
  TextBox tb = sender as TextBox;
  if (tb != null) {
    tb.SelectAll(); //select all text in TextBox
  }
}

Learn ReactJs, React Native from akashmittal.com