adding a doevents in the loop lets the screen update where the form is no long at instead of letting it just be gray until the program closes.