SearchTextBox.cs
/// <summary>
/// Finds the next match of 'SearchString'
/// </summary>
/// <returns>The line number it occurs on</returns>
Finds the next match of 'SearchString'
Finds the next match of ' SearchString '
public int FindNextMatch()
        {
            int retVal = -1;
            if (SearchString != null && !SearchString.Equals(""))
            {
                try
                {
                    Regex r;
                    r = new Regex(SearchString, RegexOptions.IgnoreCase);
                    int startAt = this.SelectionStart + 1;
                    if (startAt > this.Text.Length)
                        startAt = 0;
                    Match m = r.Match(this.Text, startAt);
                    if (m.Length == 0)
                    { 
                        m = r.Match(this.Text);
                    }
                    if (m.Length > 0)
                    {
                        this.SelectionStart = m.Index;
                        this.SelectionLength = m.Length;
                        retVal = this.GetLineFromCharIndex(this.SelectionStart);
                    }
                }
                catch { }
            }
            UpdateStatusControl(retVal);
            return retVal;
        }
public int FindNextMatch ( ) { int retVal = - 1 ; if ( SearchString != null && ! SearchString . Equals ( " " ) ) { try { Regex r ; r = new Regex ( SearchString , RegexOptions . IgnoreCase ) ; int startAt = this . SelectionStart + 1 ; if ( startAt > this . Text . Length ) startAt = 0 ; Match m = r . Match ( this . Text , startAt ) ; if ( m . Length == 0 ) { m = r . Match ( this . Text ) ; } if ( m . Length > 0 ) { this . SelectionStart = m . Index ; this . SelectionLength = m . Length ; retVal = this . GetLineFromCharIndex ( this . SelectionStart ) ; } } catch { } } UpdateStatusControl ( retVal ) ; return retVal ; }
Finds the next match of 'SearchString'
Finds the next match of ' SearchString '
// continue at the top if not found
The line number it occurs on
The line number it occurs on