Click to See Complete Forum and Search --> : search for..............


ant
July 6th, 2001, 04:13 PM
This isn't the same as before. I am making a debugger, and i need to know: When the user clicks a button it searches. If it finds the text it's looking for, it highlights it and scrolls to where the text is. How do i do that?

--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: christopherfolger@hotmail.com
for the address

John G Duffy
July 7th, 2001, 09:42 AM
What are you searching? A text file,a DataBase, a textBox a RichTextBox, a ComboBox, a Listbox or what?

John G

ant
July 7th, 2001, 10:28 AM
A richtextbox

--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: christopherfolger@hotmail.com
for the address

John G Duffy
July 8th, 2001, 09:05 AM
To search a RichTextBox, use its .Find method. There is an option on the .Find that will highlight the found text.
MSDN Help discusses the various options. Search on "Find Method" (Without the quotes of course) to locate it.


John G

AnkewDude
July 9th, 2001, 07:11 AM
Try this code dude!!

Dim pos As Integer
Dim target As String

target = "xyz" 'What ever string you are searching for

pos = InStr(0, RichText1.Text, target)

If pos > 0 Then
RichText1.SelStart = pos - 1
RichText1.SelLength = Len(target)
RichText1.SelColor = vbRed
RichText1.SelBold = True
End If

.... so lemme know if it works dude!!!

AnkewDude!

There is no Genius without a touch of madness!!!