You could try to use the following code to make the focus always on the TextBox.
The code of xaml:
<StackPanel >
<TextBox Name="textBox1" Focusable="True" FontSize="36" Height="70">hi</TextBox>
<Button Click="Button_Click" Height="60" FontSize="28">click</Button>
</StackPanel>
The code of xaml.cs:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("clicked");
}
private void Window_GotFocus(object sender, RoutedEventArgs e)
{
textBox1.Focus();
}
}
The picture of the result: