// Displays the FindReplaceDialog with the specified tab active, and sets the selection/text appropriately.
        private void ShowFindReplaceTab(string tabName)
        {
            HideIncrementalSearch();
            if (!Window.Visible)
            {
                Window.Show(Editor.FindForm());
            }

            Window.tabAll.SelectedTab = Window.tabAll.TabPages[tabName];

            if (Editor.LineFromPosition(Editor.Selections[0].Start) != Editor.LineFromPosition(Editor.Selections[0].End))
            {
                Window.chkSearchSelection.Checked = true;
            }
            if (CurrentQuery != null)
            {
                Window.txtFind.Text = CurrentQuery.ToString();
            }
            else if (Editor.Selections[0].End > Editor.Selections[0].Start)
            {
                Window.txtFind.Text = Editor.SelectedText;
            }
            Window.txtFind.Select();
            Window.txtFind.SelectAll();
        }
 /// <summary>
 /// Shows the <see cref="IncrementalSearcher"/> control.
 /// </summary>
 public void ShowIncrementalSearch()
 {
     HideFindReplace();
     SetIncrementalSearchPosition();
     if (CurrentQuery != null)
     {
         SearchBar.txtFind.Text = CurrentQuery.ToString();
     }
     else if (Editor.Selections[0].End > Editor.Selections[0].Start)
     {
         SearchBar.txtFind.Text = Editor.SelectedText;
     }
     SearchBar.Show();
     SearchBar.txtFind.Focus();
     SearchBar.txtFind.SelectAll();
 }