Results 1 to 4 of 4

Thread: combobox problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2009
    Posts
    3

    Question combobox problem

    i have 6 combobox and all of them have the same items. the items are random numbers. the problem is that i want the user to select a number from the first combobox but i dont want him to select the same number from the second one or the third. I hope you can understand what i mean.

  2. #2
    Addicted Member Dark Anima's Avatar
    Join Date
    Sep 2008
    Posts
    183

    Re: combobox problem

    Maybe create a collections of integers, and when you select a number from one of the comboboxes, remove the number from the collection. Then update the comboboxes with the new numbers? Something like this:

    Code:
        Dim AvailableNumbers As New List(Of Int32)
    
        For i As Int32 = 1 To 6
                AvailableNumbers.Add(i)
            Next
    
        Sub OnNumberSelected(ByVal Number As Int32)
            AvailableNumbers.RemoveAt(Number)
            UpdateBoxes()
        End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2009
    Posts
    3

    Re: combobox problem

    i am going to try it and see if its working. tnx

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2009
    Posts
    3

    Re: combobox problem

    since i am a beginner i cant understand that so if could explain it a little i would be greatful. oh and btw the numbers arent selected by me i use a randomize to get them.

Posting Permissions

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



Click Here to Expand Forum to Full Width