Application.DoEvents() should be what you're looking for.
However, note the following (from the linked MSDN page):
Unlike Visual Basic 6.0, the DoEvents
method does not call the Thread.Sleep
method.
Update
Given that the questions now provides an explanation of usage, I would say refactoring to use a background thread would be a better solution. DoEvents can lead to some issues as it will cause the underlying message queue to pump, which can lead to re-entrancy and a whole host of other side-effects. DoEvents has valid use-cases and I would shy from saying that it's use is bad practise - it exists for valid reasons - but in most cases, there are better solutions than just calling DoEvents.