Search and Highlight
![Visual Basic 6, or VB Classic Visual Basic 6, or VB Classic](https://www.fortypoundhead.com//assets/img/icons/v7/vb6.png)
Find a string in a textbox and highlight
Private Function FindString (Control As Control, FindStr As String, Optional StartPos As Integer = 1 ) As Boolean
Dim a As Integer
a = InStr(StartPos, LCase$(Control.Text), LCase$(FindStr))
If a = 0 Then
FindString = False
Else
FindString = True
Control.SetFocus
Control.SelStart = a - 1
Control.SelLength = Len(FindStr)
End If
End Sub
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.