Lost Focus

H

Harry

I have 3 textboxes with numeric values and would like to have a running
total showing in a label ..What event do I use to show the values, when the
textbox has LostFocus. At present I have a click event to show the final
total
 
D

Derrick Coetzee [MSFT]

Harry said:
I have 3 textboxes with numeric values and would like to have a running
total showing in a label ..What event do I use to show the values, when the
textbox has LostFocus. At present I have a click event to show the final
total

I'm not sure I'm interpreting you correctly, but:

1. To detect when the textbox has lost focus, use the TextBox.LostFocus
event. See its MSDN entry for more info. See here for a sample of some C#
code using it:
http://www.csharpsoft.com/css/article.php?sid=71

2. To update the label, simply modify the Text property of the label. You
can get the values in the textboxes using the TextBox.Text property. You may
also want to consider using a read-only textbox instead of a label, which
allows copying to the clipboard.

I hope this helps - please write back if I misunderstood your question or
you need more help.
 
H

Harry

thanks for your reply
Derrick Coetzee said:
I'm not sure I'm interpreting you correctly, but:

1. To detect when the textbox has lost focus, use the TextBox.LostFocus
event. See its MSDN entry for more info. See here for a sample of some C#
code using it:
http://www.csharpsoft.com/css/article.php?sid=71

2. To update the label, simply modify the Text property of the label. You
can get the values in the textboxes using the TextBox.Text property. You
may
also want to consider using a read-only textbox instead of a label, which
allows copying to the clipboard.

I hope this helps - please write back if I misunderstood your question or
you need more help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top