No it doesn't. CopyFiles() starts before the results of the two commands can be painted on the form and then hogs the UI preventing it being completed. Putting a sleep in there makes no difference because it simply stops all events. It looks like copyfiles could do with being on a separate thread or a background worker but in the meantime try putting in ...
Application.DoEvents()
... after Button1.Enabled = False and before CopyFiles(). In theory at least that should complete the events relating to the painting of the controls before continuing.




Reply With Quote
