1
votes

I am just multiplying 10 and data(int),I want to display data in textbox, i don't want to update value by clicking button or something. I want trigger it by the text box event only. it automatically should update it.I am using vc++ 2010, windows form application.

this is my code:

private: System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) {

       unsigned long data = 10;
       unsigned long value;

       value=5*data;

       String^ str = value.ToString();

       textBox1->Text=System::String^ str;


 }
1
Please add the code till you have doneMothy
I have added the codeuser2768702

1 Answers

0
votes

You need to put the result of the calculation in a different textbox to the one you are typing in.

As it is, when you put the new value in, it will fire the event and set it to 50 again. Which will do it again. And again. Forever. Or until the program crashes.