Added Application.DoEvents() in several areas to make the program operate smoothly :)