I would like to add Previous Button for my form,however it gives me error.Kindly help me

  • Thread starter Thread starter Gh000st
  • Start date Start date
G

Gh000st

Guest
Private findPos As Integer = 0
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim searchText As String = txtFinds.Text

Try
Dim s As String = txtFinds.Text
RichTextBox1.Focus()
findPos = RichTextBox1.Find(s, findPos, RichTextBoxFinds.None)
RichTextBox1.[Select](findPos, s.Length)


findPos += txtFinds.Text.Length + 1


Catch
MsgBox("No Matched text Found", MsgBoxStyle.OkOnly, "Invalid")
findPos = 0
End Try
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Dim searchText As String = txtFinds.Text

Try
Dim t As String = txtFinds.Text
RichTextBox1.Focus()
findPos = RichTextBox1.Find(t, findPos, RichTextBoxFinds.WholeWord)
RichTextBox1.[Select](findPos, t.Length)
findPos -= txtFinds.Text.Length


Catch
MsgBox("No Matched text Found", MsgBoxStyle.OkOnly, "Invalid")
findPos = 0
End Try

End Sub

Continue reading...
 
Back
Top