'How to make Search find words no only at the beginning but also in the middle of the

piscis

Regular
Joined
Jun 30, 2003
Messages
54
Code:
2    'How to make Search find words no only at the beginning but also in the middle of the line?
    Private Sub btnFindMachine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindMachine.Click
        Dim srchWord As String
        Dim wordIndex As Integer
        srchWord = InputBox("Enter the Machine Address to search for")
        wordIndex = lstListMachines.FindStringExact(srchWord)
        If wordIndex >= 0 Then
            lstListMachines.TopIndex = wordIndex
            lstListMachines.SelectedIndex = wordIndex
        Else
            wordIndex = lstListMachines.FindString(srchWord)
            If wordIndex >= 0 Then
                lstListMachines.TopIndex = wordIndex
                lstListMachines.SelectedIndex = wordIndex
            Else
                MsgBox("Machine Address " & srchWord & " is not in this list")
            End If
        End If
    End Sub
 
Back
Top