Advertisement
calfred2808

'search in a text

Nov 11th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.40 KB | None | 0 0
  1.  
  2.     'search in a text
  3.     Private Sub Search()
  4.  
  5.  
  6.         Dim a As String
  7.         Dim b As String
  8.         a = txtSearchBox.Text
  9.         b = InStr(txtStringsSaved.Text, a)
  10.         If b Then
  11.             txtStringsSaved.Focus()
  12.             txtStringsSaved.SelectionStart = b - 1
  13.             txtStringsSaved.SelectionLength = Len(a)
  14.         Else : MsgBox("No text Found!")
  15.         End If
  16.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement