First of all, hello all^^. actually don't know whether this is a suitable place or not to post this problem.
anyway let straight to the point., actually i have a problem with this coding for my school project.
theres no error too fix but i can't get the calculation and if statement in the right thing . don't know whether the phrase or something .
a newbie like me, already think of it.. the problem hundreds of time..
try to fix it. but still the same thing happen.
BMI Code:
Public Class Form1 Private Sub BtnResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnResult.Click Dim Weight, Height As Integer Dim BMI As Integer Weight = Val(TxtWeight.Text) Height = Val(TxtHeight.Text) BMI = (Weight \ Height) If BMI < 50 Then LblShow.Text = ("Under Weight for Your Height") Else LblShow.Text = ("Over Weight For You Height") End If End Sub Private Sub BtnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnClear.Click TxtHeight.Clear() TxtWeight.Clear() LblShow.Text = " " End Sub Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click MessageBox.Show("Bye!!") Me.Close() End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class




Reply With Quote