9
votes

This question can seem quite odd but from all my experience I've gotten used to setting keyboard focus to the focusable element just by clicking it with the mouse; however, UserControl with the properties Focusable = true and IsTabStop = true came as a surprise to me because it gets keyboard focus via Tab but stays ignorant to mouse clicks.

1

1 Answers

10
votes

Handle the click event on the UserControl and add this code to the eventhandler:

private void UserControl_OnMouseUp(object sender, MouseButtonEventArgs e)
{
   Keyboard.Focus(sender as UserControl);
}