When user wants to calculate their BMI, how do I restrict them so they can only enter integer in the textbox when the program loads?
Also if possible how can I turn the BMI answer into 2 or 1 decimal place?
CODE:
Public Class Form1
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
txtHeight.Text = txtHeight.Text / 100 ' converts txtheight into meter
lblBMI.Text = txtWeight.Text / txtHeight.Text ^ 2 'BMI is equal to txtweight divided by (txtheight)^2
'BMI = x KG / (y M * y M)
End Sub
End Class
Thats the Design
I know its probably very simple but I'm fairly new to programming, Thank you!