Cry about...
Delphi Programming with TWebBrowser


TWebBrowser - Properties


TWebBrowser has the following properties (most of these properties are shown within Object Inspector but some are only available at run-time):

Property and Type Type Description
AddressBar WordBool Flag indicates whether the address bar is shown.
Align TAlign Controls how the TWebBrowser component is aligned on the firm to its parent control (e.g. a panel).

Addendum to original kindly pointed out by Simon Price.

Application IDispath Returns the automation object that is hosting the WebBrowser control.
Busy WordBool Read only. Flag indicating whether the WebBrowser component is currently busy - either navigating or downloading.
Container IDispatch  
Cursor TCursor  
Document IDispatch Run time only. Returns information about the current document.

Cast to IHTMLDocument2 to make it usable, i.e.;

doc := WebBrowser.Document as IHTMLDocument2;

For more details follow this link.

Note: To use IHTMLDocument2, import the "Microsoft HTML Object Library" (MSHTML.TLB) and include MSHTML_TLB in the unit's uses clause.

DragCursor TCursor  
DragMode TDragMode  
FullScreen WordBool  
Height Integer Read or set height of the control.
HelpContext THelpContext Numeric ID for control’s context-sensitive help topic for use with help systems that use numeric topic IDs. For more information consult the Delphi documentation.
HelpKeyword String Help keyword. For information consult the Delphi documentation.
HelpType THelpType Indicates whether the control’s context sensitive help topic is identified by context ID or by keyword. For information consult the Delphi documentation.
Hint String  
HWND Integer Returns the handle to the explorer window.
Left Integer Read or set the left coordinate position of the control.
LocationName WideString Returns the title of the page currently viewed. If the page has no title then the filename of the file being viewed is returned instead.
LocationURL WideString Returns the URL (or address) of the page currently viewed.
MenuBar WordBool Read or set to control whether the menu bar is visible.
Name WideString The name of the control as used in code.
Offline WordBool Read or set to control whether the control is working in "offline" mode.
OleObject Variant Returns the Active X browser data. Follow this link for data details.
Parent IDispatch Returns the parent control.
ParentShowHint Boolean  
Path WideString  
PopupMenu TPopupMenu  
ReadyState OleEnum Read only; returns the state of the control; one of:
const READYSTATE_UNINITIALIZED = 0;
Default initialisation state.
const READYSTATE_LOADING = 1;
Object is currently loading data.
const READYSTATE_LOADED = 2;
Object has been initialised.
const READYSTATE_INTERACTIVE = 3;
User can interact with the object but loading has not yet finished.
const READYSTATE_COMPLETE = 4;
All of the object's data has been loaded.
RegisterAsBrowser WordBool Read or set to control whether the object is a top-level browser for name resolution.
RegisterAsDropTarget WordBool Read or set to control whether the object will accept drop-and-drag items.
Resizeable WordBool Read or set to control whether the control can be resized.
ShowHint Boolean  
Silent WordBool Read or set to control whether messages are displayed on error.
StatusBar WordBool  
TabOrder TTabOrder  
TabStop Boolean  
Tag Integer  
TheaterMode WordBool Ignored by WebBrowser. (For Internet Explorer, read or set flag indicating whether IE is in "Theatre mode". In theatre mode IE occupies the entire screen.)
ToolBar Integer  
Top Integer Read of set top coordinate position of the control.
Type_ WideString Returns the name of the type of control.
Visible WordBool Read or change to hide or show the control. If true then the control is visible. If false then the control is hidden.
Width Integer Read or set width of the control.

See also:

To report any errors or omissions please e-mail me (brian@cryer.co.uk).


These notes are believed to be correct for Delphi 6 and 7 with Internet Explorer 6, but may apply to other versions as well.



About the author: is a dedicated software developer and webmaster. For his day job he develops websites and desktop applications as well as providing IT services. He moonlights as a technical author and consultant.