Find partial text from Subitem in ListViewItem

Hi there.
I have struggeled a lot the last weeks, trying to get my search engine for my program to work, with no luck.
I tried different methods like FindItemWithText, but it will not work.

My challenge is that I have a textbox (txtSok) for the search word, and a new ListViewItem (frmTelefon) that I will populate with the result from my search.
The search routine are using data from another ListViewItem on another form (frmOPS).

I would like to have the searched done by using the TextChanged on txtSok.

My frmOPS have 5 columns, but the search is going to look for items similar to txtSok.Text in column 2.

Can anyone give me some good advice? Is any of my code interesting to see for you??
VikingS6Asked:
Who is Participating?
 
DhaestCommented:
This bit of code lets you search for ListView items and subitems by typing in the first few characters

Search for ListView items, subitems
http://searchwindevelopment.techtarget.com/0,295339,sid8_gci1173206,00.html
0
 
DhaestCommented:
here you can find a very interesting article about this subject:

How to: Add Search Capabilities to a ListView Control
http://msdn.microsoft.com/en-us/library/ms171644.aspx
0
 
VikingS6Author Commented:
It didn't work 100% with my project. I got some error trying to use the type ListItem and the function FindItem.
My VB2008 Express Edition didn't recognized these.

But from your example code, I was able to tune it a bit, and in combination with the use of the function InStr, I managed to solve my search problem.

Works OK - and that's good enogh for me.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.