我已經完成的搜索功能正在工作,但它只能找到一次單詞,我有困難的是,我不能讓搜索功能來閱讀整個文本框,並找到所有在搜索文本框中輸入的詞我如何搜索文本框中的視覺基本文本
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