I have created a C# Winforms application.
In this application I opened one form in ShowDialog mode and when I click on the OK button then it starts the process of importing contacts from a GridView to the database (the number of rows may be up to 15,000).
The problem is that when the process of importing starts I increment the value of progressBar in a loop but if the form loses focus and I once again set the focus to that form then the progress bar is not updated.
How can I update the progress bar even when the form loses focus?