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. Windows Forms
  4. Button click

Button click

Scheduled Pinned Locked Moved Windows Forms
question
3 Posts 2 Posters 2 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.
  • D Offline
    D Offline
    dodoxor
    wrote on last edited by
    #1

    Hi to everyone. I 've a ref class. In a method of the class i want to stop a while loop when a button is clicked. How can i write this condition? thanks in advance for answers, regards.

    C 1 Reply Last reply
    0
    • D dodoxor

      Hi to everyone. I 've a ref class. In a method of the class i want to stop a while loop when a button is clicked. How can i write this condition? thanks in advance for answers, regards.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The while loop needs to take place in a thread, then you can set a variable in your click event, which the loop checks every time through, and stops itself when it's set appropriately

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      D 1 Reply Last reply
      0
      • C Christian Graus

        The while loop needs to take place in a thread, then you can set a variable in your click event, which the loop checks every time through, and stops itself when it's set appropriately

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        D Offline
        D Offline
        dodoxor
        wrote on last edited by
        #3

        Thank you...it's working.

        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