CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    13

    VB.Net listbox population

    When reading the text file, i populate the
    list boxes in my form for each field. since some records in the file have duplicate field items, they show up more than once in my list box as a user selection. My list boxes are for users to select say candy flavor then write the
    selections back to the same file that it opened for reading?

    Code below in file attachment
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2003
    Posts
    13
    how can I check (strFields(1)) etc when populating a listbox with the text file? I need to eliminate duplicate record fields?

  3. #3
    Join Date
    Feb 2003
    Posts
    26

    Re: VB.Net listbox population

    Try loading the data to an array then placing the data from the array into the listbox. That way you can look through the array for any dupes and move on to the next item

    Keith

  4. #4
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: VB.Net listbox population

    You can use ListBox.FindString and ListBox.FindStringExact to see if the item is already there.

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

Featured