Vb.net 如果值在范围内,则结果为真,否则为假,如何获得值的范围

Vb.net 如果值在范围内,则结果为真,否则为假,如何获得值的范围,vb.net,Vb.net,我怎样才能得到值的范围,如果值在范围内,结果为真,否则为假。示例:第一个给定值为5,第二个给定值为8。如果I输入为5或6或7或8,则输出通过,但如果其不在范围内,则输出将失败 试一试 如果CDbl(TextBox16.Text)CDbl(TextBox14.Text),则 TextBox17.Text=“失败” 其他的 TextBox17.Text=“已通过” 如果结束 特例 显示(“必需的完整LCR规范!”,“无效流程”,MessageBoxButtons.OK,MessageBoxIcon.

我怎样才能得到值的范围,如果值在范围内,结果为真,否则为假。示例:第一个给定值为5,第二个给定值为8。如果I输入为5或6或7或8,则输出通过,但如果其不在范围内,则输出将失败

试一试

如果CDbl(TextBox16.Text)CDbl(TextBox14.Text),则
TextBox17.Text=“失败”
其他的
TextBox17.Text=“已通过”
如果结束
特例
显示(“必需的完整LCR规范!”,“无效流程”,MessageBoxButtons.OK,MessageBoxIcon.Stop)
TextBox16.Focus()
结束尝试
我想这会管用的。 您的文本框13应包含起始号码,文本框14应包含结束号码

TextBox1.Text=5
TextBox2.Text=8

 If CDbl(TextBox3.Text) >= CDbl(TextBox1.Text) And CDbl(TextBox3.Text) <= 
 CDbl(TextBox2.Text) Then
            MsgBox("Passed")
 Else
            MsgBox("failed")
 End If
TextBox1.Text=5
TextBox2.Text=8
如果CDbl(TextBox3.Text)>=CDbl(TextBox1.Text)和CDbl(TextBox3.Text)
If CDbl(TextBox16.Text) < CDbl(TextBox13.Text) Or CDbl(TextBox16.Text) > CDbl(TextBox14.Text) Then
    TextBox17.Text = "FAILED"
Else
    TextBox17.Text = "PASSED"
End If
Catch ex As Exception
MessageBox.Show(" Required Complete LCR Specification!", "Invalid Process", MessageBoxButtons.OK, MessageBoxIcon.Stop)
    TextBox16.Focus()

End Try
TextBox1.Text=5
TextBox2.Text=8

 If CDbl(TextBox3.Text) >= CDbl(TextBox1.Text) And CDbl(TextBox3.Text) <= 
 CDbl(TextBox2.Text) Then
            MsgBox("Passed")
 Else
            MsgBox("failed")
 End If