bouncing caused by unlocking if statement VB.NET
<p>Is there a solution that would generate a better output to my VB.NET if statement. I tried to keep it from locking by setting it to the min and max values while under or over these values. It works but the output is not so charming, ie the values are bouncing back and forth. </p>

<pre><code>        If MouseButtons = 1048576 Then                      ' On mouse down (within loop)
        If Track &gt;= TrackMin AndAlso Track &lt;= TrackMax Then ' Evaluate and integrate mouse position if in range
            Track = Track + (Yabs - SampleMouse)      ' Do it

        ElseIf Track &lt; TrackMin Then                    ' If smaller than Trackmin  
            Track = TrackMin                            ' Use TrackMin to avoid locking if statement
        ElseIf Track &gt; TrackMax Then                    ' If Greater than TrackMax
            Track = TrackMax                            ' Use TrackMax to avoid locking if statement
        End If
    End If
</code></pre>