VB6 richtextbox (find text)

MuK107

Senior member
Dec 30, 2001
270
0
0
you know in notpad the edit menu that has find and find next im tring to do that
 

BuckleDownBen

Banned
Jun 11, 2001
519
0
0
The richtextbox has no built-in search functions. you'll have to treat the contents like a string. what do you want to do with the text once you've found it? if you want to replace it with somethng else, VB has a replace function.

if you just want to find it try something like the following:

find string f in string s:

For i = 1 to len(s)
if mid(s, i, len(f)) = f then 'may want to put ucase's here if you don't eant case-sensitive
do something
end if
next i
 

MuK107

Senior member
Dec 30, 2001
270
0
0
how would i do this
i want to find something in the richtextbox and then i want it to show it in a diff form called frmfind in a nother textbox and have a next button so that they and skim through the places it is in the richtextbox