vb不能連等 if x>=? and x<=? then
Private Sub Command1_Click()
Text3.Text = Round(Val(Text2.Text / (Text1.Text) ^ 2), 2)
Dim x
Picture1.Cls
x = Val(Text3.Text)
If 20 <= x And x <= 22 Then
Picture1.Print "最佳"
ElseIf 18.5 <= x And x < 20 Then
Picture1.Print "正常"
ElseIf 22 < x And x < 24 Then
Picture1.Print "正常"
ElseIf x < 18.5 Then
Picture1.Print "偏瘦"
ElseIf 24 <= x And x < 28 Then
Picture1.Print "超重"
Else
Picture1.Print "肥胖"
End If
End Sub