Это не будет работать MsgBox для ошибок при некорректном вводе данныхElseIf Заявление не доходя MsgBox Ошибка
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim weight As Decimal
Dim height As Decimal
Dim bmi As Decimal
weight = InputBox("enter weight")
height = InputBox("enter height")
If weight > 10 And weight <= 600 And height >= 0.5 And height <= 2.7 Then
bmi = weight/(height)^2
ElseIf weight <= 10 And weight > 600 Then
MsgBox("you have enterd in valid data it must be above 10 and below or equal 600")
ElseIf height < 0.5 And height > 2.7 Then
MsgBox("you have enterd in valid data it must between 0.5 and 2.7 inclusive")
End If
TextBox1.Text = bmi
End Sub
ура не понимала, что я использовал «и», а не «или», –