check if webbrowser is blank
how do I check if the webbrowser is blank?
For example w开发者_StackOverflowhen you start your app, and you have a webbrowser that hasn't been navigated to anything onformcreate. its just blank
If you haven't loaded something in TWebBrowser, then it is blank. You wrote the code. So you already know if you loaded something, because you called Navigate. And there is an on complete event you could use, and hook that up to an event which sets a "SomethingLoaded" flag to true. When you call navigate, you could set a NavigateInProgress flag, which means, soon, SomethingLoaded will be set.
Update: Daemon_x and Remy both agree that ReadyState is the best solution. They didn't post that as an answer, so I'm updating this one. The uninitialized state is probably the best one.
Hard to say, what you exactly mean, but at WebBrowser start homepage different from 'about:blank' may be displayed.
if WebBrowser1.LocationURL = 'about:blank' then
ShowMessage('about:blank page is displayed ...');
But I would say you want to check, if the homepage is currently displayed
精彩评论