Results 1 to 2 of 2

Thread: I know it's something simple but...

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2001
    Posts
    34

    I know it's something simple but...

    I know it's something simple but I'm brain dead right now from the massive project I just finished. Any hoot - How do I search a list box using code instead of scrolling. I'd like to type the desired item in a text box and have the program search the list box.

    Thanx,
    Tired, confused and just plain beat down.
    Josey Wales : "You a bounty hunter?"
    Bounty Hunter : "A man's got to do something for a living these days."
    Josey Wales : "Dying ain't much of a living, boy."

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    VB Code:
    1. Private Sub Command1_Click()
    2.   For i = 0 To List1.ListCount - 1
    3.     If List1.List(i) = text1.Text Then
    4.       List1.TopIndex = i
    5.       MsgBox "found!"
    6.     End If
    7.   Next
    8. End Sub
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width