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#
  4. Program Flow

Program Flow

Scheduled Pinned Locked Moved C#
question
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.
  • P Offline
    P Offline
    puppiesLover
    wrote on last edited by
    #1

    dear my love ones,;P Say i have 2 buttons: btnDoSomeWork: implement taskX and btnTryAgain: allow user to hit btnDoSomeWork I run my program, and hit btnDoSomeWork , let it run taskX Now I hit btnTryAgain, take some new input, and have user click btnDoSomeWork the second time. This will make the 2 same taskX(s) run concurrently, which is not what i want. Is there anyway to stop the first taskX when i hit btnTryAgain? THANKS IN ADVANCE

    J 1 Reply Last reply
    0
    • P puppiesLover

      dear my love ones,;P Say i have 2 buttons: btnDoSomeWork: implement taskX and btnTryAgain: allow user to hit btnDoSomeWork I run my program, and hit btnDoSomeWork , let it run taskX Now I hit btnTryAgain, take some new input, and have user click btnDoSomeWork the second time. This will make the 2 same taskX(s) run concurrently, which is not what i want. Is there anyway to stop the first taskX when i hit btnTryAgain? THANKS IN ADVANCE

      J Offline
      J Offline
      Jon Newman
      wrote on last edited by
      #2

      Try running them in a separate thread. Then get the invoking method to abort the thread if it's running.


      "Póg mo thóin!"
      "I'm sorry but if they're gonna start talking to us about going to Uni and steering clear of drinking...then students bars shouldnt sell drinks for 50p"

      Jonathan 'nonny' Newman Homepage [www.nonny.com] [^] Bob Chum Dev site [^]

      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