private void PressedNewFind(object sender, EventArgs e)
{
int startIndex = 0;
int endIndex = 0;
int start = scripts[tabControl1.SelectedIndex].SelectionStart + scripts[tabControl1.SelectedIndex].SelectionLength;
if (openFARForm.txtSearch.Text.Length > 0)
{
startIndex = FindMyText(openFARForm.txtSearch.Text.Trim(), start, scripts[tabControl1.SelectedIndex].Text.Length);
if (startIndex == -1)
{
start = 0;
startIndex = FindMyText(openFARForm.txtSearch.Text.Trim(), start, scripts[tabControl1.SelectedIndex].Text.Length);
if (startIndex == -1)
{
MessageBox.Show("The requested string could not be found.");
return;
}
}
}
if (startIndex >= 0)
{
endIndex = openFARForm.txtSearch.Text.Length;
start = startIndex + endIndex;
}
scripts[tabControl1.SelectedIndex].Focus();
}