Guest User

Untitled

a guest
Jan 4th, 2013
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. Private Function FindLogic(ByVal LV As ListView, ByVal CIndex As Integer, ByVal SearchFor As String) As Integer
  2. Dim idx As Integer
  3. Dim It = From i In LV.Items Where i.index > CIndex And i.Text = SearchFor
  4. If It.Count > 0 Then
  5. idx = It(0).Index
  6. Else
  7. idx = -1
  8. End If
  9. Return idx
  10. End Function
  11.  
  12. Dim idx As Integer = -1
  13. For Each lvi As ListViewItem In Me.lvwData.Items
  14. If lvi.SubItems(1).Text = "TextToSearchFor" Then
  15. idx = lvi.Index
  16. End If
  17. Next
  18.  
  19. Private Function FindLogic(ByVal LV As ListView, ByVal CIndex As Integer, ByVal SearchFor As String) As Integer
  20. Dim idx As Integer
  21. Dim It = From i In LV.Items Where i.index > CIndex And i.SubItems(1).Text = SearchFor
  22. If It.Count > 0 Then
  23. idx = It(0).Index
  24. Else
  25. idx = -1
  26. End If
  27. Return idx
  28. End Function
  29.  
  30. Private Function FindLogic(ByVal LV As ListView, ByVal CIndex As Integer, ByVal Column As Integer, ByVal SearchFor As String) As Integer
  31. Dim idx As Integer
  32. Dim It = From i In LV.Items Where i.index > CIndex And i.SubItems(Column).Text = SearchFor
  33. If It.Count > 0 Then
  34. idx = It(0).Index
  35. Else
  36. idx = -1
  37. End If
  38. Return idx
  39. End Function
  40.  
  41. FindLogic(Listview1, 1, 1, "Dog")
  42.  
  43. FindLogic(Listview1, 1, LV.SelectedIndices(0), "Dog")
Add Comment
Please, Sign In to add comment