Posted By

CaptainProton on 03/01/10


Tagged

find ListBox


Versions (?)

isFoundInListbox(listbox, String) as Boolean


 / Published in: Visual Basic
 

This method checks whether a ListBox contains a certain item (based on its text).

  1. Public Function isFoundInListbox(list As listbox, item As String) as Boolean
  2. Dim i As Long
  3.  
  4. For i = 0 To list.ListCount - 1
  5. If (list.ItemData(i) = item) Then
  6. isFoundInListbox = True
  7. Exit Function
  8. End If
  9. Next i
  10.  
  11. isFoundInListbox = False
  12. End Function

Report this snippet  

You need to login to post a comment.