第1个回答 2011-10-23
text1是身高
text2是体重
Private Sub Command1_Click()
If Text2.Text > (Text1.Text - 105) * 1.1 Then
MsgBox "偏胖,加强锻炼,注意节食"
End If
If Text2.Text < (Text1.Text - 105) * 0.9 Then
MsgBox "偏瘦,增加营养"
End If
If Not Text2.Text > (Text1.Text - 105) * 1.1 And Not Text2.Text < (Text1.Text) Then
MsgBox "正常,继续保持"
End If
End Sub
Private Sub Form_Load()
Text1.MaxLength = 3
Text1.Text = ""
Text1.Alignment = 1
Text2.MaxLength = 3
Text2.Text = ""
Text2.Alignment = 1
End Sub
Private Sub Text1_Change()
On Error Resume Next
If Text1.Text = 0 Then
End If
If Err.Number = 13 Then
SendKeys "{Backspace}"
End If
End Sub
Private Sub Text2_Change()
On Error Resume Next
If Text2.Text = 0 Then
End If
If Err.Number = 13 Then
SendKeys "{Backspace}"
End If
End Sub