title: Associate / Relate two numericupdown buttons
body: <p>I am trying to create a program in VB .NET which two numericupdown buttons should be associated, if value in samp button is changed max should also be controlled and vice a versa. I have written code for it but somehow it is not working perfectly. Please let me what I am missing here.</p>
  <p>samp Minimum is set to 50 and Maximum 400; while
  max Minimum is set is 0 and Maximum 350</p>
  <pre><code>Private Sub samp_changed() Handles config_samp.ValueChanged
  
  If config_samp.Value &lt;= 400 And config_samp.Value &gt;= 299 Then
     config_max.Value = 150
  End If
  
  If config_samp.Value &lt;= 300 And config_samp.Value &gt;= 199 Then
     config_max.Value = 250
  End If
  
  If config_samp.Value &lt;= 198 And config_samp.Value &gt;= 50 Then
     config_max.Value = 350
  End If
  
  End Sub
  
  
  Private Sub max_changed() Handles config_max.ValueChanged
  
  If config_max.Value &lt;= 350 And config_max.Value &gt;= 251 Then
     config_samp.Value = 200
  End If
  
  If config_max.Value &lt;= 250 And config_max.Value &gt;= 151 Then
     config_samp.Value = 300
  End If
  
  If config_max.Value &lt;= 150 And config_max.Value &gt;= 101 Then
     config_samp.Value = 400
  End If
  
  End Sub
  </code></pre>
  <p><img src="https://i.stack.imgur.com/pTxkS.png" alt="enter image description here" /></p>