954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Interrupt Do While Loop

Hi All,

Does anyone know how to interrupt a Do While Loop?

I have a very simple bit of code that Loops though the items in a ListBox so long as a boolean (blnPaused) = False. There is a Button on the Form that sets the boolean to True but I can't figure out how to get the Click Event to work when the Do While Loop is running.

Any help would be greatly appreciated.

Thanks,

Chris (the Progress Bar is still driving me nuts!).

Chris147
Junior Poster in Training
58 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
 

Okay, I think I can't scratch this one - it just doesn't seem possible...

Thanks for looking,

Chris.

Chris147
Junior Poster in Training
58 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
 

If you are using vb 2005 then use this in your loop.

Do While Boolean
    .......
    .......
    My.Application.Doevents
Loop
waynespangler
Posting Pro in Training
461 posts since Dec 2002
Reputation Points: 84
Solved Threads: 58
 

Like all the best solutions - simple when you know how. It's the knowing how beforehand...

Thank you waynespangler!

Chris147
Junior Poster in Training
58 posts since Jun 2007
Reputation Points: 10
Solved Threads: 4
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You