You are using Windows forms, so I just tried it: two text boxes, both handled by the same event handler:
private void MyTextBoxes_MouseEnter(object sender, EventArgs e)
{
if (sender is TextBox tb)
{
tb.Focus();
}
}
And sure enough, it works: as the mouse moves between them, so does the input focus.
I'd suggest you use the debugger to see if
isRunning
is set when you don't think it should be.