Introduction
Today I am going to explain use of the WebBrowser control in F#. The WebBrowser control is essentially a managed wrapper around some COM interface that binds to Internet Explorer and provides us several capabilities. GUI applications revolve around events, and F# provides a natural way to process events with function. You can add event handlers for a WebBrowser like a status bar, Menu bar, Toolbar, Address combo box and Go Button. WebBrowser control is not one of the controls that come by default in the control box.
WebBrowser control is used to perform many of the tasks like navigating to a site, Making Page on startup, save page, open page and auto submit etc. WebBrowser control can easily be extended by adding other interface and methods. WebBrowser control use the control as an MSHTML editor. WebBrowser control also exposes some interesting events that allow a programmer to react when a document is loaded, navigation is performed etc.
First of all a user can use a WebBrowser control to display a web page in a Windows Forms application. WebBrowser Activex control used to send data by using the post method to an HTTP server like Microsoft internet information server. This control exposes an API that allows an application to embed and control a browser rendering engine. WebBrowser libraray has a Mono. Mozilla namespace, which implements the public Mono.WebBrowser interfaces.
Properties of WebBrowser
| Properties | Description |
| AccessibleRole | Get/set the accessible role of the control |
| BindingContext | Get/set the BindingContext for the control |
| AccessibilityObject | Get the AccessibilityObject assigned to the control |
| CanFocus | Get a value indicating whether the control can receive focus |
| CanSelect | Get a value indicating whether the control can be selected |
| Container | Get the IContainer that contains the component |
| DataBindings | Get the data bindings for the control |
| DefaultCursor | Get/set the default cursor for the control |
| DefaultSize | Get the default size of the control |
| DocumentTitle | Get the title of document currently Displayed in the webBrowser control |
| Height | Get/set the height of the control |
| Handle | Get the window handle that the control is bound to |
| FontColor | Get/set the height of the font of the control |



Mahesh ChandPosted Jul 29, 2011, 7:22 PM
I just noticed now you can build Windows Forms, WPF and Silverlight applications using F#. Interesting.
Sam HobbsPosted Jul 29, 2011, 5:43 PM
The managed WebBrowser Control is a wrapper around the unmanaged WebBrowser Control; see: http://msdn.microsoft.com/en-us/library/aa752040(VS.85).aspx