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)

1 comment:

  1. This is a nice article..
    Its very easy to understand ..
    And this article is using to learn something about it.., c#, javascript
    Thanks a lot..!