title: How do I randomize an array in Visual Basic 2010?
body: <p>I have any array of questions like this:</p>
  
  <pre><code>Dim Questions(25) As TheQuestions
  
  Function loadQuestions()
  
      Questions(0).Question = "Which of these words are an adjective?"
      Questions(0).option1 = "Dog"
      Questions(0).option2 = "Beautiful"
      Questions(0).option3 = "Steven"
      Questions(0).option4 = "Bird"
      Questions(0).Answer = "B"
  
      Questions(1).Question = "What's the adjective in this sentence:" &amp; vbCrLf &amp; "'Kelly handled the breakable glasses very carefully'"
      Questions(1).option1 = "Kelly"
      Questions(1).option2 = "Handled"
      Questions(1).option3 = "Carefully"
      Questions(1).option4 = "Breakable"
      Questions(1).Answer = "D"
  
      Questions(2).Question = "What's the adjective in this sentence: 'Karen is a graceful dancer'"
      Questions(2).option1 = "Is"
      Questions(2).option2 = "Graceful"
      Questions(2).option3 = "Dancer"
      Questions(2).option4 = "Tanya"
      Questions(2).Answer = "B"
      ...
  </code></pre>
  
  <p>I have found a way of randomizing the question successfully, but could I make sure that the correct, four potential answers are displayed along with the question being displayed? </p>
  
  <p>Below is the code for calling the Function which gets the question and then displays it in a label (lblQuestion) and where the code I am looking for needs to go, I am guessing:</p>
  
  <pre><code>Function GetQuestion(ByVal intQuestion As Integer)
  
      tmrOne.Start()
  
          If questionNumber &lt; 25 Then
              lblQuestionNumber.Text = "Question" &amp; " " &amp; questionNumber
              lblQuestion.Text = Questions(intQuestion).Question
              btnAnswerA.Text = Questions(intQuestion).option1
              btnAnswerB.Text = Questions(intQuestion).option2
              btnAnswerC.Text = Questions(intQuestion).option3
              btnAnswerD.Text = Questions(intQuestion).option4
              strAnswer = Questions(intQuestion).Answer
              questionNumber = questionNumber + 1
              btnAnswerA.BackColor = Color.White
              btnAnswerB.BackColor = Color.White
              btnAnswerC.BackColor = Color.White
              btnAnswerD.BackColor = Color.White
              btnAnswerA.Enabled = True
              btnAnswerB.Enabled = True
              btnAnswerC.Enabled = True
              btnAnswerD.Enabled = True
              Return intQuestion
          Else
              MsgBox("You have finished")
              End
          End If
  
  End Function
  </code></pre>
  
  <p>I used this:</p>
  
  <pre><code>lblQuestion.Text = Questions(random.Next(25)).Question
  </code></pre>
  
  <p>It randomizes the question, but how do I get it so that the four possible answers are shown with the correct question, like in the array above where there are FOUR options.</p>
  
  <p>Many thanks!</p>