
Hi,
I'm trying to implement a Find / Replace dialog box on top of the syntax editor. The core functionality is in, but I can't seem to be able to select the correct text consistently.
To find the text, I do this:To highlight the text, I do this:
This is usually WAY off the further I go down in the document. The text contains \r\n's obviously as well as \t's. I figured that was throwing things off so I tried doing a replace:
\r\n -> ""
\t -> " " (four spaces)
and using that to find the IndexOf, but that didn't work either. Any suggestions?
[Modified at 08/22/2011 12:19 PM]
I'm trying to implement a Find / Replace dialog box on top of the syntax editor. The core functionality is in, but I can't seem to be able to select the correct text consistently.
To find the text, I do this:
_nStartPos = _syntaxEditor.Text.IndexOf(tbSearch.Text, _nStartPos, ((bool)cbMatchCase.IsChecked) ? StringComparison.CurrentCulture : StringComparison.CurrentCultureIgnoreCase);
nLen = tbSearch.Text.Length;
_syntaxEditor.ActiveView.Selection.SelectRange(_nStartPos, nLen);
\r\n -> ""
\t -> " " (four spaces)
and using that to find the IndexOf, but that didn't work either. Any suggestions?
[Modified at 08/22/2011 12:19 PM]