Pages

Total Pageviews

Add This

Friday, April 29, 2011

Search Item in ListBox

Create a form like on the picture bellow:
In to the button "Search" write the code bellow:

        Dim theList As Long
        Dim textToSearch As String
        Dim theListText As String
        textToSearch = LCase(TextBox1.Text)
        For theList = 0 To ListBox1.Items.Count - 1
            theListText = LCase(ListBox1.Items.Item(theList))
            If theListText = textToSearch Then ListBox2.Items.Add(textToSearch)
        Next


No comments:

Post a Comment