[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)
Originally Posted by Lolland 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!
Looking at lollands code I understand what you wanted now, I thought you meant something completely different. Thats what I get for Originally Posted by blubb1337 You always read the first few lines then answer Oh well /Solved.
Originally Posted by NextGen1 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.
Originally Posted by Blubb1337 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