Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,934 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,484 people online right now. Registration is fast and FREE... Join Now!




searching in listview

 
Reply to this topicStart new topic

searching in listview, searching in listview true textbox

IDIS
30 Apr, 2008 - 04:41 AM
Post #1

New D.I.C Head
*

Joined: 30 Apr, 2008
Posts: 13

Hello,

My name is idi and today i ahve come to this side for first time. THis is really great!
I have a listview with playlist in the listview, true textbox i want to search in the listview. For example in the textbox i fill in the letter A and all title of songs beginning with letter A come to top of the listview, when i Fill in letters AB al songs beginning with AB are in top of the listview. I really don't now how to do tis. I have searched the net. The following i have tried. Please help me.

CODE
     Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
    
        ListView1.Items.Clear()
        ListView1.Sorting = SortOrder.Ascending
        Dim teller As Integer
        For ix As Integer = 0 To ListView1.Items.Count - 1
            Dim ls As String = ListView1.Items(ix).Text

        '    If String.Compare(ls.Substring(0, TextBox2.Text.Length), TextBox2.Text, True) = 0 Then
        '        ListView1.Items(ix).Selected = True
        '        'ListView1.Items(ix).EnsureVisible()
        '        Exit For
        '    End If
        'Next ix
    End Sub



With kind regards,

idi

This post has been edited by IDIS: 30 Apr, 2008 - 04:42 AM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Searching In Listview
30 Apr, 2008 - 09:59 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Are you wanting to only show those songs which start with the letters they type in or are you looking for it to scroll down through the playlist to the songs that begin with the letters they typed? The first choice would be a subset of the original list and the second choice would be the entire list by scrolled through to the correct area in the list.

smile.gif
User is offlineProfile CardPM
+Quote Post

IDIS
RE: Searching In Listview
30 Apr, 2008 - 10:35 AM
Post #3

New D.I.C Head
*

Joined: 30 Apr, 2008
Posts: 13

QUOTE(Martyr2 @ 30 Apr, 2008 - 10:59 AM) *

Are you wanting to only show those songs which start with the letters they type in or are you looking for it to scroll down through the playlist to the songs that begin with the letters they typed? The first choice would be a subset of the original list and the second choice would be the entire list by scrolled through to the correct area in the list.

smile.gif

the songs thats start with the letters givvin by text box in top of listview the rest under that.
thanks for the reply
User is offlineProfile CardPM
+Quote Post

IDIS
RE: Searching In Listview
6 May, 2008 - 04:40 AM
Post #4

New D.I.C Head
*

Joined: 30 Apr, 2008
Posts: 13

can anybody help me?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 04:03PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month