Auto select on tab or enter

Jan 30, 2012 at 12:30 AM

Hi

I editted the code to select the first entry when the tab or enter are hit.

Here's the change.

if (e.Key == Key.Enter || e.Key == Key.Tab)
{
    _popup.IsOpen = false;
    //START
    if (_listBox.Items.Count > 0)
    {
        UpdateText((string)_listBox.Items[0], false);
    }
    //END
    _textBox.SelectAll();
}
else if (e.Key == Key.Escape)