private void Find_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
ComboBox comboBox = ((ComboBox)sender);
if (comboBox.Text.Length > 0 && comboBox.Items != null && (comboBox.Items.Count == 0 || (string)comboBox.Items[0] != comboBox.Text))
{
comboBox.Items.Insert(0, comboBox.Text);
}
TraversalRequest tRequest = new TraversalRequest(FocusNavigationDirection.Next);
UIElement keyboardFocus = Keyboard.FocusedElement as UIElement;
if (keyboardFocus != null)
{
keyboardFocus.MoveFocus(tRequest);
}
}
else
{
mainWindow.FindNextStringOnPage(FindText.Text, false, true, this.MatchCase.IsChecked ?? true, this.RegexFind.IsChecked ?? true);
}
}