> AddHandler txt_roads_pre.Changed, AddressOf RecalculateMyNumbers
> AddHandler txt_parking_pre.changed, AddressOf RecalculateMyNumbers
Or just attach the event to the RecalculateMyNumbers method with the
handles keyword (only applicable if the controls are added at design
time)
ie
public sub RecalculateMyNumbers() handles txt_roads_pre.Changed,
txt_parking_pre.Changed, ......
end sub
Both do the same, but the second example is what the designer
generates when you map an event, while the addhandler is used mainly
for dynamic mapping of events (like for dynamically created controls).
Thanks,
Seth Rowe
On Feb 2, 2:00 pm, "RobinS" <Rob...@NoSpam.yah.none> wrote:
> You'd have to capture the Change events for every textbox, which you could
> do by adding something like this in your Form_Load event.
>
> AddHandler txt_roads_pre.Changed, AddressOf RecalculateMyNumbers
> AddHandler txt_parking_pre.changed, AddressOf RecalculateMyNumbers
>
> and so on, assuming RecalculateMyNumbers is a routine that does what it
> says.
>
> Robin S.
> Ts'i mahnu uterna ot twan ot geifur hingts uto.
> ------------------------------------------------"David Plotts" <dplo...@aesarchitechNOSPAM.com> wrote in message
>
> news:%(E-Mail Removed)...
>
> > 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_em...@yahoo.com> wrote in message
> >news:(E-Mail Removed)...
> >> 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
|