Re: Adding values in text boxes
- From: "David Plotts" <dplotts@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Feb 2007 13:39:42 -0500
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
.
- Follow-Ups:
- Re: Adding values in text boxes
- From: RobinS
- Re: Adding values in text boxes
- References:
- Adding values in text boxes
- From: David Plotts
- Re: Adding values in text boxes
- From: rowe_newsgroups
- Adding values in text boxes
- Prev by Date: VB vs C#
- Next by Date: Re: VB vs C#
- Previous by thread: Re: Adding values in text boxes
- Next by thread: Re: Adding values in text boxes
- Index(es):
Relevant Pages
|
Loading