Re: Adding values in text boxes



Great, thanks.

That label only updates with the values when it is clicked on. Is there a
way to have it update as the numbers are changed in the text box?


"rowe_newsgroups" <rowe_email@xxxxxxxxx> wrote in message
news:1170430211.387122.300860@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You could just wrap them in CInt() or Int32.Parse() or
Convert.ToInt32() etc...

All of the above will convert the Text property of the textbox into a
integer, which then be added together. If using Option Strict On you
will need to convert the sum back to a string to store in the label
though.

i.e.

lbl_impervious_pre.Text = txt_roads_pre.Text + txt_parking_pre.Text + ...

becomes,

lbl_impervious_pre.Text = CStr(CInt(txt_roads_pre.Text) +
CInt(txt_parking_pre.Text) + ... )


Thanks,

Seth Rowe



.



Relevant Pages


Loading