Home > Software engineering >  Vb hope bosses to solve the problems of weight for height
Vb hope bosses to solve the problems of weight for height

Time:09-15

Private Sub Command1 Click ()

Dim tz As Single, sg As Single, bmiAs Single

Tz=Val (Text1. Text)
Sg=Val (Text2. Text)
If (sg, 0) Then
Bmi=tz/* sg (sg)
Text3. Text=bmi
If (bmi<18.5) Then

Label4. Caption="lean your weight"
The Else

If (bmi & gt;=18.5 And bmi & lt; 24) ThenLabel4. Caption="your normal weight
"The Else

Label4. Caption="your overweight" EndIf
End the If
End the If
End Sub

CodePudding user response:

What problem? Is loathe to give up, others will look at your code?

CodePudding user response:

Change is good, you can compare the:
 
Private Sub Command1_Click ()
Dim tz As Single, sg As Single, bmi As Single
Tz=Val (Text1. Text)
Sg=Val (Text2. Text)
If (sg & gt; 0) Then
Bmi=tz/* sg (sg)
Text3. Text=bmi
If (bmi & lt; 18.5) Then
Label4. Caption="lean your weight"
The Else
If (bmi & gt;=18.5 And bmi & lt; 24) Then
Label4. Caption="your normal weight"
The Else
Label4. Caption="your overweight"
End the If
End the If
End the If
End Sub

Run the example:

Download address:
Link: https://pan.baidu.com/s/1qTWGrrJz50olpz2qnpmg1w
The extracted code: v782

CodePudding user response:

https://bbs.csdn.net/topics/392559008

With this post topic main are classmates
  • Related