wait methods!!!?
-
Hi I am not using mfc or any kind of complex thing I just work with windows forms using c++. My question is how can I have a have the following. by clicking the fist Button. user starsts a while loop. In the loop a series of events take place, and then we ask the user to input something to textBox. user enters the data and,clicks the 2nd Button. the program gets the data and goes back to the loop continueing its job. what i have so far is : private: System::Void 1stbtn_Click(System::Object * sender, System::EventArgs * e) { while (mycondition is true) { ...do the job wait for 2ndbtn to be pressed; ...do the job } } private: System::Void 2ndbtn_Click(System::Object * sender, System::EventArgs * e) { lol = textBox->Text; } what is the sytax and what libreries should be used?
-
Hi I am not using mfc or any kind of complex thing I just work with windows forms using c++. My question is how can I have a have the following. by clicking the fist Button. user starsts a while loop. In the loop a series of events take place, and then we ask the user to input something to textBox. user enters the data and,clicks the 2nd Button. the program gets the data and goes back to the loop continueing its job. what i have so far is : private: System::Void 1stbtn_Click(System::Object * sender, System::EventArgs * e) { while (mycondition is true) { ...do the job wait for 2ndbtn to be pressed; ...do the job } } private: System::Void 2ndbtn_Click(System::Object * sender, System::EventArgs * e) { lol = textBox->Text; } what is the sytax and what libreries should be used?
You're thinking sequentially, which is not how windows forms (or any windows based program) works. The wait for the 2nd and further button is done by .NET itself. Thus, when the first button is clicked, you do some stuff inside it's handler. When the second button is clicked, you do some stuff inside it's handler and so on. Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke