Technology Programming

Reset the TWebBrowser Delphi control to an Empty (Blank) Page



The TWebBrowser Delphi component allows displaying HTML and web *aware* documents inside your application.

To navigate to a document from code use the Navigate method.

Let's say you have a TWebBrowser component, named "webBrowser1", on a form. To navigate to the About Delphi Programming site main page you can use the next code line:

webBrowser1.Navigate('http://delphi.D106') ; If, for whatever the reason is, you have to clear the web browser window, "reset" it, and display an empty page, you need to navigate to a "blank" page.
Here's how do "reset" the TWebBrowser to display a blank, empty page:


webBrowser1.Navigate('about:blank') ;
Delphi tips navigator:
» Enumerating and Playing System Sounds from Delphi code
« How to Filter Files and Folders Displayed by the TShellTreeView

Leave a reply