Results 1 to 11 of 11
  1. #1
    Gbstar's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    0
    My Mood
    Pensive

    Need Help With ListBox

    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.

  2. #2
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    @Gbstar: I don't really get it. Explain it properly please.

  3. #3
    Gbstar's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    0
    My Mood
    Pensive
    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

  4. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    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
    Something like that. Modify it to match what you need exactly.

  5. #5
    Gbstar's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    0
    My Mood
    Pensive
    Thanks hassan ill send it to you once I am done making it = ] you will love it I am sure

  6. #6
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Gbstar View Post
    Thanks hassan ill send it to you once I am done making it = ] you will love it I am sure
    No problem, and I'll be waiting.

  7. #7
    Gbstar's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    0
    My Mood
    Pensive
    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.

  8. #8
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Gbstar View Post
    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
    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

  9. #9
    Gbstar's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    0
    My Mood
    Pensive
    hehe still doesn't work but its okies hassan i still love you = ] thanks for trying ill try another way

  10. #10
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by Gbstar View Post
    hehe still doesn't work but its okies hassan i still love you = ] thanks for trying ill try another way
    What ? It is working for me lol. But

  11. #11
    Gbstar's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    31
    Reputation
    10
    Thanks
    0
    My Mood
    Pensive
    erm I tried its in a timer , button, listbox form load maybe i did something wrong o.o

Similar Threads

  1. [Help Request] Need Help With A.V.A Error
    By ch1025 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 7
    Last Post: 05-14-2011, 09:15 AM
  2. [Help Request] Need help with making binds !
    By JonathanTBM in forum Vindictus Help
    Replies: 4
    Last Post: 05-10-2011, 07:40 PM
  3. [Help Request] Need help with numpad while recording macro !
    By JonathanTBM in forum Vindictus Help
    Replies: 2
    Last Post: 05-10-2011, 07:37 PM
  4. [Help Request] need help with mod
    By .:MUS1CFR34K:. in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 05-01-2011, 12:40 PM
  5. [Help Request] need help with modding
    By BayBee Alyn in forum Combat Arms Help
    Replies: 0
    Last Post: 04-27-2011, 09:06 PM