How to tell if a Windows Form has painted itself COMPLETELY
Posted on 2004-03-31
I'm trying to capture the screen of a Form which contains a browser, which works fine if I do it manually (say once you press a button or something).
The problem is how to do this programatically as the browser is opening a web page which could take a little while, and the DownloadComplete event seems to fire too early (ie it just captures a blank screen - presumably a millisecond or so before the screen properly paints.
I've tried other events, both in the form and the contained browser - none of which seem to be fired at just the right moment when the screen displays the information. Thread.Sleep() doesn't work either as it delays everything.
Is there an event I've missed which will go at the right time? Or a workaround using threads?
I've also looked at intercepting WM_PAINT messages, but couldn't get it working.
Any ideas? Cheers.