[Help]Search TextBox[Solved]

Posts 1–11 of 11 · Page 1 of 1
[Help]Search TextBox[Solved]
Ok basically a textbox is full of names in it:

It says:
Code:
NextGen1

MJLover

Ilovewater

ppl2pass
There is another textbox to type the name you want to search.
For example if i type: MJLover, it will search the whole textbox.text and go and highlight the text.
Ok here's the code, I don't have the time to explain...gtg:

[php]
Dim start
Dim [end]

'replace txtFind with the text you want to find...
Dim word_find as string= txtFind.Text

Here 'r.text' is the textbox you are searching in. Replace it with your textbox...

start = InStr(1, r.Text, word_find, CompareMethod.Text)
[end] = Len(word_find)

Try
Dim finalStr As String = Mid(r.Text, start, [end])

MsgBox("Item Found...")
Catch ex As Exception
MsgBox("Item not Found...")

End Try
[/php]

This will tell you if your item exists or not !!!!!!
Marked Solved, Any other questions feel free to post unless > 7 days

Basic + standard btw

The concept is to Find a word in a string.

String Manipulation Article in Tuts may help

1 thing.. it's i LIKE water not i LOVE water
Maybe He Loves Water , HA

Hmmm...spamming....coool

May be I should try this too later sometime !!
You just did

Okay , now no more from any of us
Another way you can do it.
[php] If TextBox1.Text.Contains("TEXT HERE") Then
'Do something
End If[/php]
But I cant find how to highlight the text.
Quote Originally Posted by Zoom View Post
Another way you can do it.
[php] If TextBox1.Text.Contains("TEXT HERE") Then
'Do something
End If[/php]
But I cant find how to highlight the text.
RichTextBox1.SelectionBackColor = color.Black

RichTextBox1.SelectionColor = color.Black
Quote Originally Posted by Zoom View Post
Another way you can do it.
[php] If TextBox1.Text.Contains("TEXT HERE") Then
'Do something
End If[/php]
But I cant find how to highlight the text.
Oh man. I just forgot about this method !! Nice
HA HA /Solved /Solved /Solved , Oh and ....solved

Avoid posting unless <=7 Days and necessary
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us