Fixed problem with flickering when resizing form