|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
'How to make Search find words no only at the beginning but also in the middle of the
Code:
'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
|
|
#2
|
|||
|
|||
|
what would a line in the list box contain? what are you searching for? are you saying you want to search the entire item to see if it contains that search string?
__________________
Programmer's Corner |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > 'How to make Search find words no only at the beginning but also in the middle of the |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|