附上我設定的Label的名稱設定。
Public Class BmiConvert
Private Sub BmiButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BmiButton.Click
Dim iBmi As Double
iBmi = CInt(WeightTextBox.Text / (HeightTextBox.Text / 100) ^ 2)
BmiShow.Text = CInt(WeightTextBox.Text / (HeightTextBox.Text / 100) ^ 2)
Select Case iBmi
Case Is < 18.5
BmiSaying.Text = "你太輕了! 多吃點好嗎?"
Case Is < 24
BmiSaying.Text = "正常範圍,除了稱讚你,也不知道該說啥"
Case Is < 27
BmiSaying.Text = "稍重,危險了~~快脫離型男、美女行列了"
Case Is < 30
BmiSaying.Text = "輕度肥胖,好啦好啦~~你很可愛"
Case Is < 35
BmiSaying.Text = "中度肥胖,別哭了,停下你手上的食物"
Case Else
BmiSaying.Text = "哇勒~~你真的有夠胖"
End Select
End Sub
End Class
沒有留言:
張貼留言