Skip to content

Incremental Search

Steve Towner edited this page May 15, 2016 · 4 revisions

Incremental Search

Incremental Search

The incremental serach toolbar can be displayed in two ways:

ToolStrip Style

In this case, the search bar can be embedded in a ToolStrip or placed directly on a form allowing access to the search bar without using a keyboard shortcut.

ToolStrip Style Incremental Search

In Editor Style

In this case, the search bar will appear on demand (using a keyboard shortcut) and appears over the ScintillaNET control. The search bar can optionally switch sides of the ScintillaNET control depending on the caret position. Navigating away from the search bar makes it disappear.

Editor Style Incremental-Search

Usage

The Incremental Search control is a component of the FindReplace class and as such, creating an instance of the FindReplace class gives the ability to show the Incremental Search control within the ScintillaNET control (actually infront of it). All that is required is to call the specific method to show the control as below.

	MyFindReplace.ShowIncrementalSearch();

Optionally the control can be dropped onto a form (in this case named 'incrementalSearcher1' and hooked directly to a FindReplace instance as shown below. In this case, the control is always visible, so a call to 'ShowIncrementalSearch' is not required.

using ScintillaNET_FindReplaceDialog;

    public partial class Form1 : Form
    {
    	// Declare variable for FindReplace dialog
        FindReplace MyFindReplace;

		public Form1()
        {
            InitializeComponent();

			MyFindReplace = new FindReplace(scintilla1);
			incrementalSearcher1.FindReplace = MyFindReplace;
        }
	}
Clone this wiki locally