title: One Textbox Value Greater then other, Avoid and Beep
body: <p><br>
  I have two Textboxes in Visual Basic 2010<br>
  <code>Textbox1</code><br>
  <code>Textbox2</code><br>
  Now I want that if user enter value(integer) in Textbox2, if the value in <code>Textbox2</code> is Greater than <code>Textbox1</code>, so this will do a beep and also avoid him to do like this<br>
  <code>Example:</code> If User write <code>5</code> in Textbox1 and now he is writing <code>8</code> in <code>Textbox2</code> so as <code>8</code> is grater than <code>5</code>, so i want that <code>Textbox2</code> ignore with a beep.<br>
  I have this code but this is not working, please if some one help me:<br></p>
  
  <blockquote>
  <pre><code>Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
  
      Dim valx1 As Integer
      Dim valx2 As Integer
  
      valx1 = (Val(TextBox1.Text))
      valx2 = (Val(TextBox2.Text))
  
  
      If (valx1) &gt; (valx2) Then
          Beep()
          e.Handled = True
      End If
  
  End Sub
  </code></pre>
  </blockquote>