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
words:
results:Code:index word 0 "word1" 1 "word2" 2 "word3"
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);
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks