Re: C++ .Net Simple Math Calculation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Ronin" <Ronin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:11299A24-F4E1-4F64-8A55-5B3346243E52@xxxxxxxxxxxxxxxx
> Group,
>
> I'm trying to add 2 textBox text... but some how does compile properly at
> all...
>
> textBox3->Text = textBox1->Text + textBox2->Text;
>
>
> How would i fix this issue? Please HELP
>
>
> Ronin

You'll need to convert the strings in the text boxes to numeric types before
you add the values.
Try something like this...

int a = Convert::ToInt32(textBox1->Text);

int b = Convert::ToInt32(textBox2->Text);

int c = a + b;

textBox3->Text = Convert::ToString(c);


--
Peter [MVP Visual Developer]
Jack of all trades, master of none.


.



Relevant Pages