Adding Textboxes

ShawnMichaels
10-13-2005, 11:37 AM
Hi Guys,

I have in my quote program, there are 4 labels

Lets Just say
Label1, Label2, Label3, Label4

How can I add the value of them together?

Thank you

Volte
10-13-2005, 11:47 AM
If you mean they are numbers and you want to sum them all:

Val(Label1.Text) + Val(Label2.Text) + Val(Label3.Text) + Val(Label4.Text)

If you want to concatenate the strings:

Label1.Text& Label2.Text& Label3.Text& Label4.Text

edit: Thanks for the correction John, I forgot where I was. Also, use Convert.ToInt32() instead of Val() in .NET.

John
10-13-2005, 01:58 PM
.Net Labels don't have a Caption property. It would be Label1.Text etc.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum