Textbox LostFocus event handling
<p>I have a LostFocus Event on my textbox, but usually when pressing the Tab key what happens is, the "LostFocus" event triggers, and the next control gets focus. i want to keep focus on the textbox (Assuming an input error happened) instead of moving focus to the next control.</p>

<p>i've tried setting the e event to handled, but nothing changed.</p>

<pre><code>private void phone(object sender, RoutedEventArgs e)
{
    TextBox text = (sender as TextBox);
    if (text.Text == "") return;
    else if (text.Text.Length &gt; 10 || text.Text.Length &lt; 10)
    {
        MessageBox.Show("Valid Input");
        select(sender);
    }
}
</code></pre>

<p>This is the event i'm trying to use, but as i said, the focus moves to the next control (which is wrong).</p>