P
pyro81
Guest
i am using the following code to search for strings in a textbox.
this searches for the string in the textbox from where the cursor is downwards....that is find but how can i get it to search from were the cursor is upwards...i know you can use INSTRREV but i cannot get anything to work...please help!
Code:
Function findstring()
Dim sstart As Integer
Dim srchmode As CompareMethod
Me.TopMost = True
If chkbox.Checked = True Then
srchmode = CompareMethod.Binary
Else
srchmode = CompareMethod.Text
End If
sstart = InStr(textbox1.SelectedText + 2, textbox1.Text, findword.Text, srchmode)
If sstart = 0 Then
MsgBox("No Match Found!",MsgBoxStyle.Information)
Else
textbox1.Select(sstart - 1, findword.Text.Length)
textbox1.ScrollToCaret()
End If
End Function
this searches for the string in the textbox from where the cursor is downwards....that is find but how can i get it to search from were the cursor is upwards...i know you can use INSTRREV but i cannot get anything to work...please help!
Last edited by a moderator: