我已经完成的搜索功能正在工作,但它只能找到一次单词,我有困难的是,我不能让搜索功能来阅读整个文本框,并找到所有在搜索文本框中输入的词我如何搜索文本框中的视觉基本文本
Private Sub btnSearch_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnSearch.Click
Dim Search As String
Dim Where As Long
' Get search string from user.
Search = InputBox("Enter text to be found:")
' Find string in text.
Where = InStr(TheText.Text, Search)
If Where <> 0 Then
TheText.Focus()
TheText.SelectionStart = Where - 1
TheText.SelectionLength = Len(Search)
Else
MsgBox("String not found.")
End If
txtR.Text = CountWords(Search)
Sorting.Items.Add(txtR.Text)
End Sub