Calculation not displaying
I’m trying to make a BMI calculator for my class and for some reason the BMI wont display. It works for other equations tho. I tried math.pow and that didn’t work either

5 Replies
I don’t get any errors when running it either. Just the lblBMI.Text part doesn’t show the BMI.tostring part. If i make double BMI = weight / height(like in the // section); It WILL show. Makes no sense
I suggest you debug, and figure out what value gets calculated
if you're taking user input I suggest using $tryparse
When you don't know if a string is actually a number when handling user input, use
int.TryParse
(or variants, e.g. double.TryParse
)
TryParse
returns a bool
, where true
indicates successful parsing.
- Avoid int.Parse
if you do not know if the value parsed is definitely a number.
- Avoid Convert.ToInt32
entirely, this is an older method and Parse
should be preferred where you know the string can be parsed.
Read more hereUnknown User•4w ago
Message Not Public
Sign In & Join Server To View
From my take all this should work correctly as far as your coding for calculate body mass indexes and assignability to the control. What no one can tell by this pic, is where the label controls visibility is set or how. More context might help us help you.
🤔