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!).

Recommended Answers

All 3 Replies

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

Thanks for looking,

Chris.

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

Do While Boolean
    .......
    .......
    My.Application.Doevents
Loop

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

Thank you waynespangler!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.