I’m reading a text file into a TextArea control and have a TextField where I can enter search text. It works with this bit of code.
Var start As Integer = 0
Var len As Integer = txtFind.Text.Length
start = InStr(txtLogData.Text, txtFind.Text)
If start >= 0 Then
txtLogData.SelectionStart = start-1
txtLogData.SelectionLength = len
txtLogData.StyledText.Bold(start, Len) = False
lastFindStart = start
lastFindLen = len
End If
This works and the first occurrence of the text (not case sensitive) is located and highlighted. What I would like to do is change the button caption to “Next” (no problem) and then do subsequent searches beyond the current highlighted text. Can I do this within the TextArea or do I need to copy the text beyond what’s been found into a string a look for it there?