title: How to make a random not deplicate with another random number VB.NET
body: <p>I'm trying to make the content of a button be a random number each time the user opens the application. Here is the code so far.</p>
  
  <pre><code> Dim rndnumber As Random
      Dim number1 As Integer
      Dim number2 As Integer
      Dim number3 As Integer
      Dim number4 As Integer
      Dim number5 As Integer
      Dim number6 As Integer
      Dim number7 As Integer
      Dim number8 As Integer
      Dim number9 As Integer
      Dim number10 As Integer
      Dim number11 As Integer
      Dim number12 As Integer
      Dim number13 As Integer
      Dim number14 As Integer
      Dim number15 As Integer
      Dim number16 As Integer
      Dim number17 As Integer
      rndnumber = New Random
  
      Do
          number1 = rndnumber.Next(0, 18)
          number2 = rndnumber.Next(0, 18)
          number3 = rndnumber.Next(0, 18)
          number4 = rndnumber.Next(0, 18)
          number5 = rndnumber.Next(0, 18)
          number6 = rndnumber.Next(0, 18)
          number7 = rndnumber.Next(0, 18)
          number8 = rndnumber.Next(0, 18)
          number9 = rndnumber.Next(0, 18)
          number10 = rndnumber.Next(0, 18)
          number11 = rndnumber.Next(0, 18)
          number12 = rndnumber.Next(0, 18)
          number13 = rndnumber.Next(0, 18)
          number14 = rndnumber.Next(0, 18)
          number15 = rndnumber.Next(0, 18)
          number16 = rndnumber.Next(0, 18)
          number17 = rndnumber.Next(0, 18)
      Loop Until number1 IsNot number2 Or number3 Or number4 Or number5 Or number6 Or number7 Or number8 Or number9 Or number10 Or number11 Or number12 Or number13 Or number14 Or number15 Or number16 Or number17
  
      button1.Content = number1.ToString
      button2.Content = number2.ToString
      button3.Content = number3.ToString
      button4.Content = number4.ToString
      button5.Content = number5.ToString
      button6.Content = number6.ToString
      button7.Content = number7.ToString
      button8.Content = number8.ToString
      button9.Content = number9.ToString
      button10.Content = number10.ToString
      button11.Content = number11.ToString
      button12.Content = number12.ToString
      button13.Content = number13.ToString
      button14.Content = number14.ToString
      button15.Content = number15.ToString
      button16.Content = number16.ToString
      button17.Content = number17.ToString
  </code></pre>
  
  <p>Here is the first of 17 buttons, i have the same code for each button but have chanaged the "loop until number1 isnot number 2" part to match each different number.</p>
  
  <p>The problem is at the "Isnot" part at the loop.</p>
  
  <p>How can i get it to understand the value of each rndnumber?</p>
  
  <p>Thanks in advanced.</p>