hi..
how do I autosearch from listview.
for example:
when I type 'A' into the textbox, all the word that begin with 'A' will appear in the listview.... :rolleyes:
TQ..
Printable View
hi..
how do I autosearch from listview.
for example:
when I type 'A' into the textbox, all the word that begin with 'A' will appear in the listview.... :rolleyes:
TQ..
listview or listbox?
i just whipped up a sample for a listview
VB Code:
Dim WordList() As String Private Sub Form_Load() ListView1.ListItems.Add , , "AAA" ListView1.ListItems.Add , , "AAB" ListView1.ListItems.Add , , "ABB" ListView1.ListItems.Add , , "BBA" ListView1.ListItems.Add , , "BBC" ListView1.ListItems.Add , , "DDE" ListView1.ListItems.Add , , "FFF" ListView1.ListItems.Add , , "FFG" ListView1.ListItems.Add , , "RRR" ReDim WordList(0) For x = 1 To ListView1.ListItems.Count WordList(x - 1) = ListView1.ListItems(x).Text If x <> ListView1.ListItems.Count Then ReDim Preserve WordList(UBound(WordList) + 1) Next End Sub Private Sub Text1_Change() ListView1.ListItems.Clear For x = 0 To UBound(WordList) If Text1 = "" Then ListView1.ListItems.Add , , WordList(x) Else If LCase(Left(WordList(x), Len(Text1))) = LCase(Text1) Then ListView1.ListItems.Add , , WordList(x) End If End If Next End Sub
this is with the listview set to 2-lvwList for the view setting
This looks pretty slick. I have to go to a meeting but I'm gonna bookmark this and try it out later. :thumb:
I have few colums in both of my listview..but i just need to display some colums from the first listview to the second one..Quote:
Originally Posted by [A51g]Static
I am new to vb so I don't really see how I can modified your code..... :blush:
remove the stuff about the Wordlist()
just use this:
VB Code:
Private Sub Text1_Change() ListView2.ListItems.Clear For x = 1 To ListView1.ListItems.Count If Text1 = "" Then ListView2.ListItems.Add , , ListView1.ListItems(x).Text Else If LCase(Left(ListView1.ListItems(x).Text, Len(Text1))) = LCase(Text1) Then ListView2.ListItems.Add , , ListView1.ListItems(x).Text End If End If Next End Sub
you will need to add subitems as weel for each of your columns, but this should get you going ! (I hope) ;)
Thanks [A51g]Static..
I already find the solution myself...its almost the same as yours
:bigyello: :wave:
Post your solution and share it with the rest of us.Quote:
Originally Posted by yatt