fyiReporting.RdlDesign.RdlEditPreview.FindNext C# (CSharp) Method

FindNext() public method

public FindNext ( Control ctl, string str, bool matchCase, bool revertSearch, bool showEndMsg = true ) : void
ctl System.Windows.Forms.Control
str string
matchCase bool
revertSearch bool
showEndMsg bool
return void
        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;
            }
        }

Usage Example

Beispiel #1
0
 private void btnNext_Click(object sender, System.EventArgs e)
 {
     rdlEdit.FindNext(this, txtFind.Text, chkCase.Checked);
 }