vs[2005] adding textboxes
ok.. this sounds very stupid but i just forgot how to add more than 2 textboxes...my code looks something like this
....blablabla haldles button.click
dim number as integer
number = txta.text + txtb.text + txtc.text
it just doesnt work can u tell me how to do it properly im newb.
thank u
Re: vs[2005] adding textboxes
Quote:
Originally Posted by Un33k
ok.. this sounds very stupid but i just forgot how to add more than 2 textboxes...my code looks something like this
....blablabla haldles button.click
dim number as integer
number = txta.text + txtb.text + txtc.text
it just doesnt work can u tell me how to do it properly im newb.
thank u
that code should work assuming that there is only integers in your textboxes. You can manually cast all the values to integers by doing:
vb Code:
number = convert.ToInt32(txta.text)+convert.ToInt32(txtb.text)+convert.ToInt32(txtc.text)
of course then you must do something with the variable number now that it contains the added values
Re: vs[2005] adding textboxes
vb Code:
Dim number As Integer = Cint(txta.text) + Cint(txtb.Text) + Cint(txtC.Text)
You should look at Integer.TryParse to make sure that the text in the textboxes can actually be added