How to push a button while a loop is running?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jose Luis Barrio
    New Member
    • Aug 2010
    • 4

    How to push a button while a loop is running?

    I have an application that has a textbox and 3 buttons. With the first button I generate a random code and is showed in the textbox. The second button generates codes automatically and I want to use the third button to stop this last process but I can't because while the loop is running it doesn't allow me to push any of the buttons of the form. (The loop is a while). Why is this happening? How can I click this button while the loop is running?

    Thanks in advance for your answers.

    Jose Luis
  • uosef64
    New Member
    • Aug 2010
    • 2

    #2
    hi joes
    the best way to fix your problem is that you run your second function with a thread and in third button find the thread that you create in 2nd then stop or abort it.
    for tutorial threading in c# search web and see joe albehari article about this.

    Comment

    Working...