-
Notifications
You must be signed in to change notification settings - Fork 29
Incremental Search
The incremental serach toolbar can be displayed in two ways:
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.
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.
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;
}
}