943,907 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 7802
  • VB.NET RSS
Oct 22nd, 2007
0

Interrupt Do While Loop

Expand Post »
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!).
Similar Threads
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
Chris147 is offline Offline
58 posts
since Jun 2007
Oct 22nd, 2007
0

Re: Interrupt Do While Loop

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

Thanks for looking,

Chris.
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
Chris147 is offline Offline
58 posts
since Jun 2007
Oct 22nd, 2007
0

Re: Interrupt Do While Loop

If you are using vb 2005 then use this in your loop.
VB.NET Syntax (Toggle Plain Text)
  1. Do While Boolean
  2. .......
  3. .......
  4. My.Application.Doevents
  5. Loop
Reputation Points: 84
Solved Threads: 58
Posting Pro in Training
waynespangler is offline Offline
461 posts
since Dec 2002
Oct 23rd, 2007
0

Re: Interrupt Do While Loop

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

Thank you waynespangler!
Reputation Points: 10
Solved Threads: 4
Junior Poster in Training
Chris147 is offline Offline
58 posts
since Jun 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Convert date to timestamp format
Next Thread in VB.NET Forum Timeline: Retrieving Fields from MS Access





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC