@Gbstar: I don't really get it. Explain it properly please.
Ok so here is the deal I have a listbox now this list box needs to keep count of 36 numbers and when there's 10 of the same number in this listbox a msgbox pops up now how would I go about that?
Or
same scenario but with only 6 groups of numbers but having them to numbers I can preset example group 1 is 1,4,7,10,13,16,19,22,25,28,31,34 now these numbers will be checked every time I enter another number like 3 so if the hit 10 the msgbox pops up
Thanks Tim
Last edited by Gbstar; 01-20-2012 at 06:59 PM.
@Gbstar: I don't really get it. Explain it properly please.
Ok so I have a listbox I am adding numbers to it and when there's 10 of the same number in this listbox I would like a msgbox to pop up saying Yay!
hope that's better explained
Something like that. Modify it to match what you need exactly.Code:Dim ItemToAdd As String = "Lucky Item" Dim Count As Integer = 0 For i As Integer = 1 To 25 If Count >= 10 Then MsgBox("Yay ! 10 same items in the list.") 'You can also uncomment the following line so that the counter resets after every 10 items. 'Count = 0 End If ListBox1.Items.Add(i.ToString()) Count += 1 Next
Thanks hassan ill send it to you once I am done making it = ] you will love it I am sure
Wait hehe that adds numbers = X hehe i need it to tell me when 10 of the same numbers are in the listbox = [
ok so here ill kinda draw a picture
listbox
1
1 (then mgsbox*yay theres 10 ones in your list box*)
1
1
1
1
1
1
1
1
Last edited by Gbstar; 01-21-2012 at 03:21 AM.
This should work. Guess I misread what you said previously.
Code:Dim ItemToCheck As String = "Lucky Item" Dim Count As Integer = 0 For Each Item As String In ListBox1.Items If Item = ItemToCheck Then Count += 1 End If If Count >= 10 Then MsgBox("Yay ! Found the item. It was found in the list for " + Count.ToString() + " times.") 'Count = 0 End If Next
hehe still doesn't work but its okies hassan i still love you = ] thanks for trying ill try another way
erm I tried its in a timer , button, listbox form load maybe i did something wrong o.o