WebBrowser.WebBrowserSite Class
Collapse the table of content
Expand the table of content

WebBrowser.WebBrowserSite Class


Represents the host window of a WebBrowser control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)


	Flags = SecurityPermissionFlag.UnmanagedCode)]
protected class WebBrowserSite : WebBrowserSiteBase


Initializes a new instance of the WebBrowser.WebBrowserSite class.


This API supports the product infrastructure and is not intended to be used directly from your code. Releases all resources used by the WebBrowserSiteBase. (Inherited from WebBrowserSiteBase.)


This API supports the product infrastructure and is not intended to be used directly from your code. Releases the unmanaged resources used by the WebBrowserSiteBase and optionally releases the managed resources. (Inherited from WebBrowserSiteBase.)


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns a string that represents the current object.(Inherited from Object.)

If you are familiar with OLE development using the unmanaged WebBrowser ActiveX control, you can extend the functionality of the Windows Forms WebBrowser control, which is a managed wrapper for the ActiveX control. You can use this extensibility, for example, to customize the browser shortcut menu and shortcut keys or to provide a custom security configuration for hosted documents.

To use this feature, implement classes that inherit from the WebBrowser and WebBrowser.WebBrowserSite classes. The unmanaged WebBrowser ActiveX control uses the protected WebBrowser.CreateWebBrowserSiteBase method to retrieve extensibility interfaces implemented by the WebBrowser.WebBrowserSite class. Override the CreateWebBrowserSiteBase method to return an instance of your own class that inherits from the WebBrowser.WebBrowserSite class. The WebBrowser.WebBrowserSite class provides a default implementations of the OLE IDocHostUIHandler interface. For more information, see IDocHostUIHandler Interface in the MSDN library. You can provide your own implementation of this interface or implement any other WebBrowser ActiveX control interface in order to customize the behavior of the control. For more information, see WebBrowser Control in the MSDN library.


If you provide your own implementation for any IDocHostUIHandler members, you must implement all the members of that interface.


for overriding this type, which requires access to unmanaged code. Associated enumerations: SecurityAction.InheritanceDemand and SecurityPermissionFlag.UnmanagedCode

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
© 2015 Microsoft