Shane Partridge
Visual Basic 2013
OOP Language : Body Mass Index Calculus
Categorises your BMI Weight Assessment.
Visual Basic - An Event Driven Programming Language
Building the GUI-Based Programming Language
by Inserting Controls from the Tool Box onto the Graphic Template listed below.
1. Right Click on Graphics Image : Then Press Save Image as to Folder
- The Graphics Chart below corresponds to the Tool Box Controls
- Making Graphic User Interface [GUI] Easier to Build.
2. Copy Coding onto Forms VB for Program Execution.
3. In VB Design Mode : Drag Picture Box from Tool Box.
4. Set Picture Box Size Mode to Stretch Image.
In Forms Design Mode - Properties set Size to (1069,805)
In PictureBox Properties - Set Size to (1012,726)
5. Download Graphic Image below from allocated Folder.
In Private Sub Button_1 if only 1 Form is being used.
Terminate Form9.Show()
Me.Hide()
Then add Me.Close() ' To Close Program.
If only using 1 Windows Form : Public Class = Public Class Form1
Follow and Insert the TextBox, LabelBox and Button Controls from ToolBox
and allocate them on the Graphics.
The Program Categorises your Weight Assessment : Into (1 of 4 Weight Categories).
Public Class Form13
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Form9.Show()
Me.Hide()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'Dimension Variables for Calculus
Dim height, weight, bmi As Double
Dim N As String = "n3"
'Assign TextBox Values to Variables
height = TextBox1.Text
weight = TextBox2.Text
'Body Mass Index Formula
bmi = (weight) / (height ^ 2)
'Assign Body Mass Index Value to Label
Label1.Text = bmi.ToString(N)
'Test bmi Parrameters for Weight Class distribution.
If bmi <= 18.5 Then : Label2.Text = "Under Weight"
End If
If bmi >= 18.5 And bmi <= 24.9 Then : Label2.Text = "Normal Weight"
End If
If bmi >= 25 And bmi <= 29.9 Then : Label2.Text = "Over Weight"
End If
If bmi >= 30 Then : Label2.Text = "Obesity"
End If
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'Clear TextBox & Labels
TextBox1.Text = ""
TextBox2.Text = ""
Label1.Text = ""
Label2.Text = ""
End Sub
End Class