Penjelasan Program
Program ini adalah program untuk menghitung berat badan proporsional seseorang. Berat badan tersebut dihitung dengan cara mengurangi tinggi badan dengan 110. Dengan begitu kita dapat mengetahui berat badan kita yg proporsional. Ketika berat badan dan tinggi badan telah dimasukkan maka program akan running. Bila berat badan belum proporsional maka akan ada petunjuk berat badan harus ditambah atau dikurangi berapa.
Source Code
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label3.Visible = True
Label4.Visible = True
Label5.Visible = True
Label6.Visible = True
Label7.Visible = True
If (TextBox2.Text - 110) = TextBox1.Text Then
Label7.Text = "Berat badan anda proporsional"
Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False
ElseIf (TextBox2.Text - 110) > TextBox1.Text Then
Label3.Text = "Berat badan anda tidak proporsional"
Label4.Text = "Berat badan anda kurang"
Label5.Text = (TextBox2.Text - 110) - TextBox1.Text
Label6.Text = "Kg"
Label7.Visible = False
ElseIf (TextBox2.Text - 110) < style="color: blue;">Then
Label3.Text = "Berat badan anda tidak proporsional"
Label3.TextAlign = HorizontalAlignment.Center
Label4.Text = "Berat badan anda kelebihan"
Label5.Text = TextBox1.Text - (TextBox2.Text - 110)
Label6.Text = "Kg"
Label7.Visible = False
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
Label3.Visible = False
Label4.Visible = False
Label5.Visible = False
Label6.Visible = False
Label7.Visible = False
TextBox1.Focus()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.CenterToScreen()
Me.Visible = False
TextBox1.Focus()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Button1.Visible = True
Button2.Visible = True
Button3.Visible = True
Button4.Visible = False
TextBox1.Enabled = True
TextBox2.Enabled = True
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class
Tidak ada komentar:
Posting Komentar