title: Validate two textboxes (C #)
body: <p>I have two textboxes, which prompts the user to enter an integer in each of them. I already have the code all done (code to validate if the texboxes are not empty, if only integers are entered and if the number inserted in the 2nd texbox is greater than the number entered in the 1st texbox.
  I leave here a simple example of my code (I already have all the code done):</p>
  
  <pre><code>private async void generate_Click(object sender, RoutedEventArgs e)
  {
      if (String.IsNullOrWhiteSpace(min.Text) || String.IsNullOrWhiteSpace(max.Text))
      {
          // I already have the code done ...
          // error message
      }    
      else
      { 
          // I already have the code done ...
          // Here it does the operation with the two numbers entered
      }
  }
  
  private async void min_TextChanged(object sender, TextChangedEventArgs e)
  {
      if (System.Text.RegularExpressions.Regex.IsMatch(min.Text, "[^0-9]"))
      {
          // I already have the code done ...
          // error message
      }
  
  }
  
  private async void max_TextChanged(object sender, TextChangedEventArgs e)
  {
      if (System.Text.RegularExpressions.Regex.IsMatch(max.Text, "[^0-9]"))
      {
          // I already have the code done ...
          // error message
      }
  }
  </code></pre>
  
  <p>I only have one question: Where do I put the code (I already have this code done) to verify that the number entered in the 2nd textbox is greater than the number entered in the 1st texbox? This is my question.</p>
  
  <p>Update: I just want to know where I put the code: </p>
  
  <pre><code>if (maxValue &lt; minValue) 
  { 
       // I already have the code done ... 
       // error message 
  }
  </code></pre>