title: Set focus in WPF textbox
body: <p>I am writing a control in WPF that draws a shape on a form and then draws dimensions of this shape. These dimensions are editable so they are shown in a text box. When the user changes a dimension in a text box the shape is updated. </p>
  
  <p>I am updating the shape when the textbox showing the dimension loses focus i.e. as soon as the text box loses the focus the shape and all the dimensions are redrawn. A text box loses focus in one of two ways - either when user presses tab key or when user clicks in another control outside the text box. </p>
  
  <p>My problem is that when user presses tab key or clicks somewhere else outside the text box the whole control is redrawn and the focus is not set to the next control where it should be. This is really annoying because tabs stop working altogether and to set a focus using mouse the user has to click twice. Is there a way around this?</p>
  
  <p>An image of my control is shown below</p>
  
  <p><a href="http://img223.imageshack.us/img223/9496/cavity.png" rel="nofollow noreferrer">alt text http://img223.imageshack.us/img223/9496/cavity.png</a></p>