I am having trouble with a for/next loop and a form.

When I click a command button, a for next loop pings a series of ip address specified by the user. This works fine, but while the loop is running, the form is unresponsive to mouse clicks, gets stuck behind other widows ect. until the loop finishes. Then the form returns to normal.

I added a form1.refresh to the loop, so now it redraws itself if I Move a window over it, but it still gets stuck behind other windows, and will not redraw itself on top, until the loop is finished.

Could someone please explain why this is happening?
The Loop will typically take 4 1/2 minutes to run, during this time it looks like the app is locked execpt for the progress bar moving on the form.

Thank You