ok i did the find method but i have a problem..it also needs to act as a "find next"...meaning that
1.when i click the find button,
2.in the main form, it should find the text
3. and when i click it again
4. it should find the same text again ..if it's in the main form
i can't figure out how to write the loop..plz help...
this is what i have so far
- Private Sub xFindButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles xFindButton.Click
-
-
Dim startPos As Integer
-
startPos = xTxtSourceTextBox.Text.IndexOf(Me.xFindTextBox.Text) ', type)
-
If startPos = 0 Then
-
Me.xTxtSourceTextBox.Focus()
-
-
End If
-
If startPos < 0 Then
-
MessageBox.Show("The String '" + xFindTextBox.Text + _
-
"' could not be found", "Text Not Found", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
-
Return
-
End If
-
Me.xTxtSourceTextBox.Focus()
-
xTxtSourceTextBox.Select(startPos, xFindTextBox.Text.Length)
-
xTxtSourceTextBox.ScrollToCaret()