Search Tools Links Login

Search and Highlight

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
      FindString = True
      Control.SelStart = a - 1
      Control.SelLength = Len(FindStr)
   End If
End Sub

About this post

Posted: 2020-08-30
By: vb6boy
Viewed: 238 times


Visual Basic 6


No attachments for this post

Loading Comments ...


No comments have been added for this post.

You must be logged in to make a comment.