Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. wait methods!!!?

wait methods!!!?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++winformscareer
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mitil20390482304
    wrote on last edited by
    #1

    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?

    J 1 Reply Last reply
    0
    • M mitil20390482304

      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?

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups