Results 1 to 5 of 5

Thread: How do I scan the contents of a listbox and add a value if it doesn't exist in list?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    2

    Question How do I scan the contents of a listbox and add a value if it doesn't exist in list?

    What I am trying to do is check the contents of a list box to find out if the value the user entered in a text box already exists in the list box. If it does, I'll display something like "This value already exists in the list". If not, I'll add the value to the listbox. I think I need to scan the contents of the listbox using a loop, but I can't get the syntax right. Help please.

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2004
    Posts
    2

    Question

    Thanks, but I'm affraid I'm not too familiar with the syntax in your example. The contents of my listbox will never be too large, so I think it would be easy for me to use a loop. Still not sure of the syntax I'd use though. I tried it a few different ways, but kept ending up in an infinite loop, and had to do the "cntr+alt+delete" thing a few times.

  4. #4

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by Prizm24
    Thanks, but I'm affraid I'm not too familiar with the syntax in your example. The contents of my listbox will never be too large, so I think it would be easy for me to use a loop. Still not sure of the syntax I'd use though. I tried it a few different ways, but kept ending up in an infinite loop, and had to do the "cntr+alt+delete" thing a few times.
    If you end up in an infinite loop you can hit Ctrl + Pause/Break and it will pause your program


    Has someone helped you? Then you can Rate their helpful post.

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