Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim s As String = txt.text
Dim f As String = e.Form.Controls("检索内容").text
Dim idx As Integer = vars("i")
If idx > 0 Then
idx = s.IndexOf(f, idx)
End If
If idx > -1 Then
vars("i") = idx + f.Length
txt.SelectionStart = idx
txt.SelectionLength = f.Length
Dim d = txt.BaseControl
d.ScrollToCaret
txt.select
Else
vars("i") = 0
End If
是全部高亮了 滚动到了对应位置 需要是关键词高亮 请教老师