[Help]Code[Solved]

Posts 1–8 of 8 · Page 1 of 1
[Help]Code[Solved]
Im trying to do this:

Code:
Label4.Text = TextBox1.Text & " + " & TextBox2.Text & " = " & TextBox1.Text + TextBox2.Text
To show the result of Textbox1 + Textbox2 ...Like 5 + 5 = 10 ..

But it do that: 5 + 5 = 55

If you didn understand , Ask me xD
Convert it to integer?
Code:
Label4.Text = TextBox1.Text & " + " & TextBox2.Text & " = " & cint(TextBox1.Text) + cint( TextBox2.Text)
(this only works if it's numeric though)
Quote Originally Posted by Lolland View Post
Convert it to integer?
Code:
Label4.Text = TextBox1.Text & " + " & TextBox2.Text & " = " & cint(TextBox1.Text) + cint( TextBox2.Text)
(this only works if it's numeric though)
YAY! Thats right!

XD
Sorry for waste of time xD
Thanks.


Thanks , and Solved!

NVM misunderstood questions
Looking at lollands code I understand what you wanted now, I thought you meant something completely different.
Thats what I get for

Quote Originally Posted by blubb1337
You always read the first few lines then answer
Oh well

/Solved.
Quote Originally Posted by NextGen1 View Post
Looking at lollands code I understand what you wanted now, I thought you meant something completely different.
Thats what I get for



Oh well

/Solved.
I want to do Textbox1 + Textbox2 = Result ..Like 5 + 5 = 10..
But my code was doing Textbox1 + Textbox2 = 55 (5 + 5 = 55)..

Solution:
Must put it as integer..
Thank you all.
Ik this is solved but just for explanation.

You were trying to add strings together.

5(str) & 5485415(str) will result 55485415(str). It will just add the string.

Cint converts the string into an integer so VB knows that you want to add them.

If this now sounds weird, I just woke up and idk what I'm writing atm, I'm still half asleep.
Quote Originally Posted by Blubb1337 View Post
Ik this is solved but just for explanation.

You were trying to add strings together.

5(str) & 5485415(str) will result 55485415(str). It will just add the string.

Cint converts the string into an integer so VB knows that you want to add them.

If this now sounds weird, I just woke up and idk what I'm writing atm, I'm still half asleep.
Thanks for the info
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?