public void FindNext(Control ctl, string str, bool matchCase, bool revertSearch, bool showEndMsg = true)
{
if (_CurrentTab != DesignTabs.Edit)
return;
scintilla1.SearchFlags = matchCase ? SearchFlags.MatchCase : SearchFlags.None;
HighlightWord(str);
if (revertSearch)
{
scintilla1.TargetStart = scintilla1.SelectionStart;
scintilla1.TargetEnd = 0;
}
else
{
scintilla1.TargetStart = scintilla1.SelectionEnd;
scintilla1.TargetEnd = scintilla1.TextLength;
}
var pos = scintilla1.SearchInTarget(str);
if (pos == -1)
{
if (showEndMsg)
MessageBox.Show(ctl, Strings.RdlEditPreview_ShowI_ReachedEndDocument);
}
else
{
scintilla1.GotoPosition(pos);
scintilla1.SelectionStart = scintilla1.TargetStart;
scintilla1.SelectionEnd = scintilla1.TargetEnd;
}
}