title: How to validate number range array in textbox in visual basic?
body: <p>So basically in a form, you have 3 textboxes and each of them you can input a number, then you have a button that check if each of these textboxes are in a range of numbers specified. It's very much like a lock combo, but I need help checking values, for example;
  <img src="https://i.stack.imgur.com/KFtyc.png" alt="enter image description here"></p>
  
  <p>the only thing i can figure out is</p>
  
  <pre><code>Dim intOne As Integer
      Dim intTwo As Integer
      Dim intThree As Integer
      Dim blnInputOk As Boolean = True
  
      If Integer.TryParse(lblOne.Text, intOne) = False Then
          MessageBox.Show("Value must be an integer")
          blnInputOk = False
      End If
  
      If Integer.TryParse(lblTwo.Text, intTwo) = False Then
          MessageBox.Show("Value must be an integer")
          blnInputOk = False
      End If
  
      If Integer.TryParse(lblThree.Text, intThree) = False Then
          MessageBox.Show("Value must be an integer")
          blnInputOk = False
      End If
  
      If intOne &gt;= 6 And intOne &lt;= 8 Then
          If intTwo &gt;= 2 And intOne &lt;= 9 Then
              If intThree &gt;= 0 And intThree &lt;= 8 Then
                  MessageBox.Show("Good code!")
              Else
                  MessageBox.Show("Wrong, number must be between range 0 to 8")
              End If
          Else
              MessageBox.Show("Wrong, number must be between range 2 to 9")
          End If
      Else
          MessageBox.Show("Wrong, number must be between range 6 to 8")
      End If
  </code></pre>
  
  <p>So my question is how can you make this code simpler by adding an array for number range for each textbox? I also know there is a possibility of adding a loop, but i'm not sure how to structure it, can anyone help? thanks</p>