Closed Thread
Results 1 to 3 of 3

Thread: list question

  1. #1
    Siten0308's Avatar
    Siten0308 is offline Programming Professional
    Join Date
    Jun 2008
    Location
    California, USA
    Posts
    302
    Rep Power
    16

    Question list question

    Hello, I have a problem, or a situation i guess not a problem, wondering and hoping someone can help me shed some light on my situation.

    ok so i have a list of words, and foreach word i look up stuff and each word came back with 10 results, so for example, i have 3 words in the list, i press submit button, then it goes to looks up info, lets say a database, then comes back with 10 results for each word, so in this case it will be 30 (3 words, 10 results, 30..), but the 3 words are in a listbox, so the user has the ability to click or even double click on it, and i want to happen is if the user double clicks on a certain word in the listbox (which is 1 of the 3), to only populate the 10 results for the word double clicked, i have made a double click event for the listbox but not sure where or how to do it exactly... FYI the 30 results are in 1 list which makes it hard for me to think on how to split it up to see which word came from where or show only 10 results of the word double clicked in the listbox... also another FYI sometimes it will not always be 10 results, maybe one word brings 5 results, another 7 and the last word 10, so it will be 22, and maybe the 3 words may be 10 words.... so any ideas?
    Its only funny till someone gets hurt.... THEN ITS HILARIOUS

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    lobo521 is offline Learning Programmer
    Join Date
    Jan 2010
    Posts
    57
    Rep Power
    8

    Re: list question

    words:
    Code:
    index    word
    0        "word1"
    1        "word2"
    2        "word3"
    results:
    Code:
    wordIndex    result
    0            "result1"
    0            "result2"
    1            "result3"
    2            "result4"
    Code:
    var words = new [] {"word1", "word2", "word3"};
    var results.GetResultsFromDb(words);
    int selectedWord = 0;
    var visbleResults = results.Where(r => r.WordIndex == 0);

  4. #3
    Davide's Avatar
    Davide is offline Programming God
    Join Date
    Dec 2009
    Location
    Manchester, UK
    Posts
    507
    Blog Entries
    8
    Rep Power
    11

    Re: list question

    Ok, i didn't understod the question so i will assume you have a listBox.

    Clear it before adding new items, or it will add the same items as before in addition to what you have.

    listBox1.Items.Clear()
    Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 10-08-2010, 11:31 PM
  2. Replies: 0
    Last Post: 08-17-2010, 01:52 PM
  3. Question about list Slicing (in a Hangman game)
    By Cory Duchesne in forum Python
    Replies: 2
    Last Post: 04-15-2010, 09:18 PM
  4. C# noob question 3, list question
    By Siten0308 in forum C# Programming
    Replies: 3
    Last Post: 01-21-2010, 07:41 AM
  5. Simple list question
    By tarmael in forum Python
    Replies: 5
    Last Post: 10-27-2008, 08:11 PM

Tags for this Thread

Bookmarks

Posting Permissions

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