Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21278

Searching a listbox for exact items?

$
0
0
Hi there everyone! I am working on a prog where I search for items in a wildlist listbox.

I found code where I could search for items "like" the one I want.

like this..

VB Code:
  1. Dim i As Integer
  2.  
  3.  For i = 0 To WildList.ListCount - 1
  4.  If WildList.List(i) Like "1" Then
  5.  MsgBox "Item #" & (i + 1) & " is what you searched for"
  6.   'Select the found entry
  7.  WildList.ListIndex = i
  8.  End If
  9.  Next


For ex: if I was searching for the item "1", if it found 11, it would bring it up as a possible match, because 1 and 11 are "like" each other. I think prob cause they share the same characters, but what I would like to do is get rid of the like, and search for an exact match. Would anyone have any experience with that? :) :) Thanks!

Viewing all articles
Browse latest Browse all 21278

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>