public static void ShowForFind(TextEditor editor)
        {
            if (_theDialog == null)
            {
                _theDialog = new FindReplaceDialog(editor);
                _theDialog.tabMain.SelectedIndex = 0;
                _theDialog.Show();
                _theDialog.Activate();
            }
            else
            {
                _theDialog.tabMain.SelectedIndex = 0;
                _theDialog.Activate();
            }

            if (!editor.TextArea.Selection.IsMultiline)
            {
                _theDialog.txtFind.Text = _theDialog.txtFind2.Text = editor.TextArea.Selection.GetText();
                _theDialog.txtFind.SelectAll();
                _theDialog.txtFind2.SelectAll();
                _theDialog.txtFind2.Focus();
            }
        }
 private void Find_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     FindReplaceDialog.ShowForFind(TxtBoxDoc);
 }