I have 2 ListBoxes. ListBox1 is populated with 5 selected numbers from a CheckedListBox(LotteryBox) and ListBox2 is populated with random numbers 1-99. I want to find a way to verify if the numbers in the two ListBoxes match. For Example, if they matched one number. It'll say "You've matched one number". and so on. I think I'm on the right path with:
But how do I differentiate between the five numbers selected in the LotteryBox?
Can you make the selected items in each of the boxes into a collection and do anything like this on it? That will avoid your having to iterate the box 5×.
Campbell Ritchie wrote:Can you make the selected items in each of the boxes into a collection and do anything like this on it? That will avoid your having to iterate the box 5×.
Duplicating discussion in our VB forum.
I'm not real sure how to to that. Here's the entire code:
I tried to create a collection, as suggested. I received an error stating that Unable to cast object of type 'System.Int32' to type 'System.Windows.Forms.Control'
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
Gift giving made easy with the permaculture playing cards