Private Sub TextBox1_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
If ComboBox1.SelectedIndex > -1 Then
Dim SplitValues() As String = ComboBox1.SelectedItem.ToString.Split("-"c)
Dim lowerValue As Integer = Convert.ToInt32(SplitValues(0))
Dim upperValue As Integer = Convert.ToInt32(SplitValues(1))
Dim TestValue As Integer
If Integer.TryParse(TextBox1.Text, TestValue) Then
If TestValue < lowerValue Or TestValue > upperValue Then
MsgBox("Please enter a Number in the Valid Range Selected!")
e.Cancel = True
End If
Else
MsgBox("Please enter a Valid Number for the Weight!")
e.Cancel = True
End If
End If
End Sub