Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Richtextbox - find and replace


'Each time called, finds next occurence of StringToFind
Static S_Start As Long , StringToFind As String
S_Start = RichTextBox1.Find(StringToFind, S_Start)
If S_Start = - 1 Then
   MsgBox "Not found"
Else
   RichTextBox1.SetFocus
   S_Start = S_Start + Len(StringToFind)
End If