Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
3610 lines (3170 sloc) 296 KB
<Type Name="WebBrowser" FullName="System.Windows.Forms.WebBrowser">
<TypeSignature Language="C#" Value="public class WebBrowser : System.Windows.Forms.WebBrowserBase" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit WebBrowser extends System.Windows.Forms.WebBrowserBase" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.WebBrowser" />
<TypeSignature Language="VB.NET" Value="Public Class WebBrowser&#xA;Inherits WebBrowserBase" />
<TypeSignature Language="C++ CLI" Value="public ref class WebBrowser : System::Windows::Forms::WebBrowserBase" />
<TypeSignature Language="F#" Value="type WebBrowser = class&#xA; inherit WebBrowserBase" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.WebBrowserBase</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("DocumentCompleted")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("Url")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.WebBrowserDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Windows.Forms.Docking(System.Windows.Forms.DockingBehavior.AutoDock)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.WebBrowserDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0">
<AttributeName>System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Enables the user to navigate Web pages inside your form.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control lets you host Web pages and other browser-enabled documents in your Windows Forms applications. You can use the <xref:System.Windows.Forms.WebBrowser> control, for example, to provide integrated HTML-based user assistance or Web browsing capabilities in your application. Additionally, you can use the <xref:System.Windows.Forms.WebBrowser> control to add your existing Web-based controls to your Windows Forms client applications.
> [!IMPORTANT]
> The <xref:System.Windows.Forms.WebBrowser> control is resource-intensive. Be sure to call the <xref:System.ComponentModel.Component.Dispose> method when you are finished using the control to ensure that all resources are released in a timely fashion. You must call the <xref:System.ComponentModel.Component.Dispose> method on the same thread that attached the events, which should always be the message or user-interface (UI) thread.
The <xref:System.Windows.Forms.WebBrowser> control cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](~/docs/framework/misc/using-libraries-from-partially-trusted-code.md).
The <xref:System.Windows.Forms.WebBrowser> control has several properties, methods, and events related to navigation. The following members let you navigate the control to a specific URL, move backward and forward through the navigation history list, and load the home page and search page of the current user:
- <xref:System.Windows.Forms.WebBrowser.Url%2A>
- <xref:System.Windows.Forms.WebBrowser.Navigate%2A>
- <xref:System.Windows.Forms.WebBrowser.GoBack%2A>
- <xref:System.Windows.Forms.WebBrowser.GoForward%2A>
- <xref:System.Windows.Forms.WebBrowser.GoHome%2A>
- <xref:System.Windows.Forms.WebBrowser.GoSearch%2A>
If the navigation is unsuccessful, a page indicating the problem is displayed. Navigation with any of these members causes the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events to occur at different stages of navigation.
These and other members, such as the <xref:System.Windows.Forms.WebBrowser.Stop%2A> and <xref:System.Windows.Forms.WebBrowser.Refresh%2A> methods, let you implement user interface controls in your application similar to those in Internet Explorer. Some members are useful even when you do not want to display the <xref:System.Windows.Forms.WebBrowser> control on your form. For example, you can use the <xref:System.Windows.Forms.WebBrowser.Print%2A> method to print the latest version of a Web page without displaying the page to the user.
The <xref:System.Windows.Forms.WebBrowser> control also lets you display content that you create in your application or you retrieve from a database or resource file. Use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> or <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property to get or set the contents of the current document as a string or data stream.
You can also manipulate the contents of a Web page through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property, which contains an <xref:System.Windows.Forms.HtmlDocument> object that provides managed access to the HTML document object model (DOM) for the current page. This property is useful, when used in combination with the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property, to implement two-way communication between your application code and dynamic HTML (DHTML) code in a Web page, letting you combine Web-based controls and Windows Forms controls in a single user interface. You can use the <xref:System.Windows.Forms.WebBrowser.Document%2A> property to call scripting code methods from your application. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to the object that you specify for the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property.
The <xref:System.Windows.Forms.WebBrowser> control is a managed wrapper for the ActiveX [WebBrowser control](https://go.microsoft.com/fwlink/?LinkId=198812), and uses whichever version of the control is installed on the user's computer.
> [!NOTE]
> This class makes security demands at the class level. A <xref:System.Security.SecurityException> is thrown when a derived class or any caller in the call stack does not have full trust permission. For details about security demands, see [Link Demands](~/docs/framework/misc/link-demands.md) and [Inheritance Demands](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)).
> [!NOTE]
> The <xref:System.Windows.Forms.WebBrowser> class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the <xref:System.STAThreadAttribute> attribute.
## Examples
The following code example demonstrates how to implement an address bar for use with the <xref:System.Windows.Forms.WebBrowser> control. This example requires that you have a form that contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#6](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#6)]
[!code-csharp[System.Windows.Forms.WebBrowser#6](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#6)]
[!code-vb[System.Windows.Forms.WebBrowser#6](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#6)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for derived classes to inherit this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.InheritanceDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<related type="Article" href="https://msdn.microsoft.com/library/12667861-5b5b-46bc-8fb5-675e25264c9f">WebBrowser Control (Windows Forms)</related>
<related type="Article" href="https://msdn.microsoft.com/library/dd66cd4c-b087-415f-9c3e-94e3a1835f74">Using Libraries from Partially Trusted Code</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public WebBrowser ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; WebBrowser();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.WebBrowser" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
By default, the <xref:System.Windows.Forms.WebBrowser> control is empty. To navigate it to an initial document, set the <xref:System.Windows.Forms.WebBrowser.Url%2A> property.
## Examples
The following code example demonstrates the use of this member.
[!code-csharp[WebBrowserMisc#10](~/samples/snippets/csharp/VS_Snippets_Winforms/WebBrowserMisc/CS/WebBrowserMisc.cs#10)]
[!code-vb[WebBrowserMisc#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb#10)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The <see cref="T:System.Windows.Forms.WebBrowser" /> control is hosted inside Internet Explorer.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
</Docs>
</Member>
<Member MemberName="AllowNavigation">
<MemberSignature Language="C#" Value="public bool AllowNavigation { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowNavigation" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.AllowNavigation" />
<MemberSignature Language="VB.NET" Value="Public Property AllowNavigation As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AllowNavigation { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowNavigation : bool with get, set" Usage="System.Windows.Forms.WebBrowser.AllowNavigation" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the control can navigate to another page after its initial page has been loaded.</summary>
<value>
<see langword="true" /> if the control can navigate to another page; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property does not prevent you from loading an initial page by setting the <xref:System.Windows.Forms.WebBrowser.Url%2A>, <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> or <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property, but will prevent all subsequent navigation.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
</Docs>
</Member>
<Member MemberName="AllowWebBrowserDrop">
<MemberSignature Language="C#" Value="public bool AllowWebBrowserDrop { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowWebBrowserDrop" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop" />
<MemberSignature Language="VB.NET" Value="Public Property AllowWebBrowserDrop As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AllowWebBrowserDrop { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowWebBrowserDrop : bool with get, set" Usage="System.Windows.Forms.WebBrowser.AllowWebBrowserDrop" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the <see cref="T:System.Windows.Forms.WebBrowser" /> control navigates to documents that are dropped onto it.</summary>
<value>
<see langword="true" /> if the control accepts documents that are dropped onto it; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
By default, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to documents that are dropped onto it. This behavior is useful when you use the control as a generic browser. If you use the control to display content designed specifically for your application, such as HTML-based user assistance, set the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> property to `false` to prevent the display of other content. This is particularly useful when you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls.
You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> and <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> properties to `false`.
> [!NOTE]
> This property is not related to the <xref:System.Windows.Forms.Control.AllowDrop%2A?displayProperty=nameWithType> property and does not cause drag-and-drop events such as the <xref:System.Windows.Forms.Control.DragDrop?displayProperty=nameWithType> event to occur for the control.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> property.
[!code-csharp[System.Windows.Forms.WebBrowser.ObjectForScripting#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.WebBrowser.ObjectForScripting#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled" />
<altmember cref="P:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="AttachInterfaces">
<MemberSignature Language="C#" Value="protected override void AttachInterfaces (object nativeActiveXObject);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void AttachInterfaces(object nativeActiveXObject) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.AttachInterfaces(System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub AttachInterfaces (nativeActiveXObject As Object)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void AttachInterfaces(System::Object ^ nativeActiveXObject);" />
<MemberSignature Language="F#" Value="override this.AttachInterfaces : obj -&gt; unit" Usage="webBrowser.AttachInterfaces nativeActiveXObject" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="nativeActiveXObject" Type="System.Object" />
</Parameters>
<Docs>
<param name="nativeActiveXObject">An object that represents the underlying ActiveX control.</param>
<summary>Called by the control when the underlying ActiveX control is created.</summary>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>Derived classes can override this method to cast the underlying ActiveX object to an appropriate interface and cache it in a member variable. This value must then be released in an override of the <see cref="M:System.Windows.Forms.WebBrowserBase.DetachInterfaces" /> method.</para>
</block>
</Docs>
</Member>
<Member MemberName="CanGoBack">
<MemberSignature Language="C#" Value="public bool CanGoBack { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CanGoBack" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.CanGoBack" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property CanGoBack As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool CanGoBack { bool get(); };" />
<MemberSignature Language="F#" Value="member this.CanGoBack : bool" Usage="System.Windows.Forms.WebBrowser.CanGoBack" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether a previous page in navigation history is available, which allows the <see cref="M:System.Windows.Forms.WebBrowser.GoBack" /> method to succeed.</summary>
<value>
<see langword="true" /> if the control can navigate backward; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. The <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method navigates the <xref:System.Windows.Forms.WebBrowser> control to the previous page in this history, if one is available. Use the <xref:System.Windows.Forms.WebBrowser.CanGoBack%2A> property to determine whether navigation history is available and contains a previous page. If this property is `true`, the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method will succeed. Otherwise, calling the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method will return a value of `false` and no navigation will occur.
You can also handle the <xref:System.Windows.Forms.WebBrowser.CanGoBackChanged> event to receive a notification when the <xref:System.Windows.Forms.WebBrowser.CanGoBack%2A> property changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the <xref:System.Windows.Forms.WebBrowser> control navigates to or leaves the beginning of the navigation history.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.CanGoBack%2A> property to implement a **Back** button for the <xref:System.Windows.Forms.WebBrowser> control that is similar to the **Back** button in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `backButton`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#7](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#7)]
[!code-csharp[System.Windows.Forms.WebBrowser#7](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#7)]
[!code-vb[System.Windows.Forms.WebBrowser#7](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#7)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="E:System.Windows.Forms.WebBrowser.CanGoBackChanged" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
</Docs>
</Member>
<Member MemberName="CanGoBackChanged">
<MemberSignature Language="C#" Value="public event EventHandler CanGoBackChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler CanGoBackChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.CanGoBackChanged" />
<MemberSignature Language="VB.NET" Value="Public Event CanGoBackChanged As EventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ CanGoBackChanged;" />
<MemberSignature Language="F#" Value="member this.CanGoBackChanged : EventHandler " Usage="member this.CanGoBackChanged : System.EventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event CanGoBackChanged As EventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.WebBrowser.CanGoBack" /> property value changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. The <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method navigates the <xref:System.Windows.Forms.WebBrowser> control to the previous page in this history, if one is available. The <xref:System.Windows.Forms.WebBrowser.CanGoBack%2A> property indicates whether navigation history is available and contains a previous page. Handle the <xref:System.Windows.Forms.WebBrowser.CanGoBackChanged> event to receive a notification when the <xref:System.Windows.Forms.WebBrowser.CanGoBack%2A> property changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the <xref:System.Windows.Forms.WebBrowser> control navigates to or leaves the beginning of the navigation history.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.CanGoBackChanged> event to implement a **Back** button for the <xref:System.Windows.Forms.WebBrowser> control that is similar to the **Back** button in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `backButton`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#7](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#7)]
[!code-csharp[System.Windows.Forms.WebBrowser#7](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#7)]
[!code-vb[System.Windows.Forms.WebBrowser#7](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#7)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.CanGoBack" />
<altmember cref="T:System.EventArgs" />
<altmember cref="T:System.EventHandler" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
</Docs>
</Member>
<Member MemberName="CanGoForward">
<MemberSignature Language="C#" Value="public bool CanGoForward { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool CanGoForward" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.CanGoForward" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property CanGoForward As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool CanGoForward { bool get(); };" />
<MemberSignature Language="F#" Value="member this.CanGoForward : bool" Usage="System.Windows.Forms.WebBrowser.CanGoForward" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether a subsequent page in navigation history is available, which allows the <see cref="M:System.Windows.Forms.WebBrowser.GoForward" /> method to succeed.</summary>
<value>
<see langword="true" /> if the control can navigate forward; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. The <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method navigates the <xref:System.Windows.Forms.WebBrowser> control to the next page in this history, if one is available as a result of a previous backward navigation. If this property is `true`, the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method will succeed. Otherwise, calling the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method will return a value of `false` and no navigation will occur.
Use the <xref:System.Windows.Forms.WebBrowser.CanGoForward%2A> property to determine whether navigation history is available and contains a page located after the current one, allowing the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to succeed.
You can also handle the <xref:System.Windows.Forms.WebBrowser.CanGoForwardChanged> event to receive a notification when the <xref:System.Windows.Forms.WebBrowser.CanGoForward%2A> property changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the <xref:System.Windows.Forms.WebBrowser> control navigates to or leaves the end of the navigation history.
## Examples
The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.CanGoForward%2A> event to implement a **Forward** button for the <xref:System.Windows.Forms.WebBrowser> control that is similar to the **Forward** button in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonForward`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#8](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#8)]
[!code-csharp[System.Windows.Forms.WebBrowser#8](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#8)]
[!code-vb[System.Windows.Forms.WebBrowser#8](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#8)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="E:System.Windows.Forms.WebBrowser.CanGoForwardChanged" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
</Docs>
</Member>
<Member MemberName="CanGoForwardChanged">
<MemberSignature Language="C#" Value="public event EventHandler CanGoForwardChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler CanGoForwardChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.CanGoForwardChanged" />
<MemberSignature Language="VB.NET" Value="Public Event CanGoForwardChanged As EventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ CanGoForwardChanged;" />
<MemberSignature Language="F#" Value="member this.CanGoForwardChanged : EventHandler " Usage="member this.CanGoForwardChanged : System.EventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event CanGoForwardChanged As EventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.WebBrowser.CanGoForward" /> property value changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. The <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method navigates the <xref:System.Windows.Forms.WebBrowser> control to the next page in this history, if one is available as a result of a previous backward navigation. The <xref:System.Windows.Forms.WebBrowser.CanGoForward%2A> property indicates whether navigation history is available and contains a page located after the current one, allowing the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to succeed. Handle the <xref:System.Windows.Forms.WebBrowser.CanGoForwardChanged> event to receive a notification when the <xref:System.Windows.Forms.WebBrowser.CanGoForward%2A> property changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the <xref:System.Windows.Forms.WebBrowser> control navigates to or leaves the end of the navigation history.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to implement a **Forward** button for the <xref:System.Windows.Forms.WebBrowser> control that is similar to the **Forward** button in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonForward`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#8](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#8)]
[!code-csharp[System.Windows.Forms.WebBrowser#8](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#8)]
[!code-vb[System.Windows.Forms.WebBrowser#8](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#8)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.CanGoForward" />
<altmember cref="T:System.EventArgs" />
<altmember cref="T:System.EventHandler" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
</Docs>
</Member>
<Member MemberName="CreateSink">
<MemberSignature Language="C#" Value="protected override void CreateSink ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void CreateSink() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.CreateSink" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub CreateSink ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void CreateSink();" />
<MemberSignature Language="F#" Value="override this.CreateSink : unit -&gt; unit" Usage="webBrowser.CreateSink " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Associates the underlying ActiveX control with a client that can handle control events.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control.
## Examples
The following code example illustrates the use of this method in a class derived from <xref:System.Windows.Forms.WebBrowser> that supplements the normal <xref:System.Windows.Forms.WebBrowser> events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface.
[!code-csharp[WebBrowserExtensibility#00](~/samples/snippets/csharp/VS_Snippets_Winforms/WebBrowserExtensibility/CS/WB2.cs#00)]
[!code-vb[WebBrowserExtensibility#00](~/samples/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb#00)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.DetachSink" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://msdn.microsoft.com/library/aa768283.aspx">DWebBrowserEvents2 Interface</related>
</Docs>
</Member>
<Member MemberName="CreateWebBrowserSiteBase">
<MemberSignature Language="C#" Value="protected override System.Windows.Forms.WebBrowserSiteBase CreateWebBrowserSiteBase ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Windows.Forms.WebBrowserSiteBase CreateWebBrowserSiteBase() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.CreateWebBrowserSiteBase" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateWebBrowserSiteBase () As WebBrowserSiteBase" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Windows::Forms::WebBrowserSiteBase ^ CreateWebBrowserSiteBase();" />
<MemberSignature Language="F#" Value="override this.CreateWebBrowserSiteBase : unit -&gt; System.Windows.Forms.WebBrowserSiteBase" Usage="webBrowser.CreateWebBrowserSiteBase " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.WebBrowserSiteBase</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a reference to the unmanaged <see langword="WebBrowser" /> ActiveX control site, which you can extend to customize the managed <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<returns>A <see cref="T:System.Windows.Forms.WebBrowser.WebBrowserSite" /> that represents the <see langword="WebBrowser" /> ActiveX control site.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.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 <xref:System.Windows.Forms.WebBrowser> and <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> classes. The unmanaged `WebBrowser` ActiveX control uses the protected <xref:System.Windows.Forms.WebBrowser.CreateWebBrowserSiteBase%2A> method to retrieve extensibility interfaces implemented by the <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class. Override the <xref:System.Windows.Forms.WebBrowser.CreateWebBrowserSiteBase%2A> method to return an instance of your own class that inherits from the <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class. The <xref:System.Windows.Forms.WebBrowser.WebBrowserSite> class provides default implementations of the OLE `IDocHostUIHandler` interface. 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.
> [!NOTE]
> If you provide your own implementation for any `IDocHostUIHandler` members, you must implement all the members of that interface.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="T:System.Windows.Forms.WebBrowser.WebBrowserSite" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://msdn.microsoft.com/library/aa753260.aspx">IDocHostUIHandler Interface</related>
</Docs>
</Member>
<Member MemberName="DefaultSize">
<MemberSignature Language="C#" Value="protected override System.Drawing.Size DefaultSize { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Size DefaultSize" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.DefaultSize" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property DefaultSize As Size" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual property System::Drawing::Size DefaultSize { System::Drawing::Size get(); };" />
<MemberSignature Language="F#" Value="member this.DefaultSize : System.Drawing.Size" Usage="System.Windows.Forms.WebBrowser.DefaultSize" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Drawing.Size</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the default size of the control.</summary>
<value>Gets the default size of the control.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="DetachInterfaces">
<MemberSignature Language="C#" Value="protected override void DetachInterfaces ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void DetachInterfaces() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.DetachInterfaces" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub DetachInterfaces ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void DetachInterfaces();" />
<MemberSignature Language="F#" Value="override this.DetachInterfaces : unit -&gt; unit" Usage="webBrowser.DetachInterfaces " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Called by the control when the underlying ActiveX control is discarded.</summary>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>Derived classes can override this method to release a reference to the underlying ActiveX object that was cached in an override of the <see cref="M:System.Windows.Forms.WebBrowserBase.AttachInterfaces(System.Object)" /> method.</para>
</block>
</Docs>
</Member>
<Member MemberName="DetachSink">
<MemberSignature Language="C#" Value="protected override void DetachSink ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void DetachSink() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.DetachSink" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub DetachSink ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void DetachSink();" />
<MemberSignature Language="F#" Value="override this.DetachSink : unit -&gt; unit" Usage="webBrowser.DetachSink " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases the event-handling client attached in the <see cref="M:System.Windows.Forms.WebBrowser.CreateSink" /> method from the underlying ActiveX control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is useful if you are familiar with OLE development using the unmanaged `WebBrowser` ActiveX control and you want to extend the functionality of the Windows Forms <xref:System.Windows.Forms.WebBrowser> control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control.
## Examples
The following code example illustrates the use of this method in a class derived from <xref:System.Windows.Forms.WebBrowser> that supplements the standard <xref:System.Windows.Forms.WebBrowser> events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface.
For the complete code example, see <xref:System.Windows.Forms.WebBrowser.CreateSink%2A>.
[!code-csharp[WebBrowserExtensibility#10](~/samples/snippets/csharp/VS_Snippets_Winforms/WebBrowserExtensibility/CS/WB2.cs#10)]
[!code-vb[WebBrowserExtensibility#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb#10)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.CreateSink" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://msdn.microsoft.com/library/aa768283.aspx">DWebBrowserEvents2 Interface</related>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Dispose(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Dispose (disposing As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Dispose(bool disposing);" />
<MemberSignature Language="F#" Value="override this.Dispose : bool -&gt; unit" Usage="webBrowser.Dispose disposing" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="disposing" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="disposing">
<see langword="true" /> to release both managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</param>
<summary>Releases the unmanaged resources used by the <see cref="T:System.Windows.Forms.WebBrowser" /> and optionally releases the managed resources.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Document">
<MemberSignature Language="C#" Value="public System.Windows.Forms.HtmlDocument Document { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Windows.Forms.HtmlDocument Document" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.Document" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Document As HtmlDocument" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::HtmlDocument ^ Document { System::Windows::Forms::HtmlDocument ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Document : System.Windows.Forms.HtmlDocument" Usage="System.Windows.Forms.WebBrowser.Document" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.HtmlDocument</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets an <see cref="T:System.Windows.Forms.HtmlDocument" /> representing the Web page currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<value>An <see cref="T:System.Windows.Forms.HtmlDocument" /> representing the current page, or <see langword="null" /> if no page is loaded.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this property when you want to access the contents of a Web page displayed in the <xref:System.Windows.Forms.WebBrowser> control through the HTML document object model (DOM). This is useful, for example, when you want to use Web-based controls in your Windows Forms application.
You can use this property, in combination with the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property, to implement two-way communication between a Web page displayed in the <xref:System.Windows.Forms.WebBrowser> control and your application. Use the <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A?displayProperty=nameWithType> method to call script methods implemented in a Web page from your client application code. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to an object that you specify for the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property.
To access the contents of a Web page as a string, use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property. To access the contents of a Web page as a <xref:System.IO.Stream>, use the <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Document%2A> property in a handler for the <xref:System.Windows.Forms.WebBrowser.Navigating> event to determine whether a Web page form has been filled in. If the input field does not contain a value, the navigation is canceled.
This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`.
[!code-csharp[WebBrowserMisc#30](~/samples/snippets/csharp/VS_Snippets_Winforms/WebBrowserMisc/CS/WebBrowserMisc.cs#30)]
[!code-vb[WebBrowserMisc#30](~/samples/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb#30)]
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentStream" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentText" />
<altmember cref="T:System.Windows.Forms.HtmlDocument" />
<altmember cref="M:System.Windows.Forms.HtmlDocument.InvokeScript(System.String,System.Object[])" />
<altmember cref="P:System.Windows.Forms.WebBrowser.ObjectForScripting" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="DocumentCompleted">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.WebBrowserDocumentCompletedEventHandler DocumentCompleted;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.WebBrowserDocumentCompletedEventHandler DocumentCompleted" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.DocumentCompleted" />
<MemberSignature Language="VB.NET" Value="Public Event DocumentCompleted As WebBrowserDocumentCompletedEventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::WebBrowserDocumentCompletedEventHandler ^ DocumentCompleted;" />
<MemberSignature Language="F#" Value="member this.DocumentCompleted : System.Windows.Forms.WebBrowserDocumentCompletedEventHandler " Usage="member this.DocumentCompleted : System.Windows.Forms.WebBrowserDocumentCompletedEventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event DocumentCompleted As WebBrowserDocumentCompletedEventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.WebBrowserDocumentCompletedEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control finishes loading a document.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control navigates to a new document whenever one of the following properties is set or methods is called:
- <xref:System.Windows.Forms.WebBrowser.Url%2A>
- <xref:System.Windows.Forms.WebBrowser.DocumentText%2A>
- <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A>
- <xref:System.Windows.Forms.WebBrowser.Navigate%2A>
- <xref:System.Windows.Forms.WebBrowser.GoBack%2A>
- <xref:System.Windows.Forms.WebBrowser.GoForward%2A>
- <xref:System.Windows.Forms.WebBrowser.GoHome%2A>
- <xref:System.Windows.Forms.WebBrowser.GoSearch%2A>
Handle the <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event to receive notification when the new document finishes loading. When the <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event occurs, the new document is fully loaded, which means you can access its contents through the <xref:System.Windows.Forms.WebBrowser.Document%2A>, <xref:System.Windows.Forms.WebBrowser.DocumentText%2A>, or <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property.
To receive notification before navigation begins, handle the <xref:System.Windows.Forms.WebBrowser.Navigating> event. Handling this event lets you cancel navigation if certain conditions have not been met, for example, when the user has not completely filled out a form. Handle the <xref:System.Windows.Forms.WebBrowser.Navigated> event to receive notification when the <xref:System.Windows.Forms.WebBrowser> control finishes navigation and has begun loading the document at the new location.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this event to print a document after it has fully loaded.
[!code-csharp[WebBrowserMisc#10](~/samples/snippets/csharp/VS_Snippets_Winforms/WebBrowserMisc/CS/WebBrowserMisc.cs#10)]
[!code-vb[WebBrowserMisc#10](~/samples/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb#10)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentStream" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentText" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoHome" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoSearch" />
<altmember cref="Overload:System.Windows.Forms.WebBrowser.Navigate" />
<altmember cref="E:System.Windows.Forms.WebBrowser.Navigated" />
<altmember cref="E:System.Windows.Forms.WebBrowser.Navigating" />
<altmember cref="P:System.Windows.Forms.WebBrowser.Url" />
<altmember cref="T:System.Windows.Forms.WebBrowserDocumentCompletedEventArgs" />
<altmember cref="T:System.Windows.Forms.WebBrowserDocumentCompletedEventHandler" />
</Docs>
</Member>
<Member MemberName="DocumentStream">
<MemberSignature Language="C#" Value="public System.IO.Stream DocumentStream { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.IO.Stream DocumentStream" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.DocumentStream" />
<MemberSignature Language="VB.NET" Value="Public Property DocumentStream As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::IO::Stream ^ DocumentStream { System::IO::Stream ^ get(); void set(System::IO::Stream ^ value); };" />
<MemberSignature Language="F#" Value="member this.DocumentStream : System.IO.Stream with get, set" Usage="System.Windows.Forms.WebBrowser.DocumentStream" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a stream containing the contents of the Web page displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<value>A <see cref="T:System.IO.Stream" /> containing the contents of the current Web page, or <see langword="null" /> if no page is loaded. The default is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this property to load a Web page into the <xref:System.Windows.Forms.WebBrowser> control from a <xref:System.IO.Stream> object. You can use this property, for example, to load Web pages from a database or resource file. When you set this property, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to the about:blank URL before loading the specified text. This means that the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events occur when you set this property, and the value of the <xref:System.Windows.Forms.WebBrowser.Url%2A> property is no longer meaningful.
> [!NOTE]
> This property contains the contents of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new content. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler.
To access the contents of a Web page as a string, use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property. You can also access the page contents using the HTML document object model (DOM) through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.Document" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentText" />
<altmember cref="T:System.IO.Stream" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="DocumentText">
<MemberSignature Language="C#" Value="public string DocumentText { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DocumentText" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.DocumentText" />
<MemberSignature Language="VB.NET" Value="Public Property DocumentText As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ DocumentText { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.DocumentText : string with get, set" Usage="System.Windows.Forms.WebBrowser.DocumentText" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the HTML contents of the page displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<value>The HTML text of the displayed page, or the empty string ("") if no document is loaded.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this property when you want to manipulate the contents of an HTML page displayed in the <xref:System.Windows.Forms.WebBrowser> control using string processing tools. You can use this property, for example, to load pages from a database or to analyze pages using regular expressions. When you set this property, the <xref:System.Windows.Forms.WebBrowser> control automatically navigates to the about:blank URL before loading the specified text. This means that the <xref:System.Windows.Forms.WebBrowser.Navigating>, <xref:System.Windows.Forms.WebBrowser.Navigated>, and <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> events occur when you set this property, and the value of the <xref:System.Windows.Forms.WebBrowser.Url%2A> property is no longer meaningful.
> [!NOTE]
> This property contains the text of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the <xref:System.Windows.Forms.WebBrowser> control has not had time to load the new content. You can retrieve the new value in a <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event handler. Alternatively, you can block the thread until the document is loaded by calling the <xref:System.Threading.Thread.Sleep%2A?displayProperty=nameWithType> method in a loop until the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property returns the value that you originally set it to.
To access the contents of a Web page as a <xref:System.IO.Stream>, use the <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> property. You can also access the page contents using the HTML document object model (DOM) through the <xref:System.Windows.Forms.WebBrowser.Document%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.DocumentText%2A> property to programmatically display document content of your choosing. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`.
[!code-csharp[WebBrowserMisc#30](~/samples/snippets/csharp/VS_Snippets_Winforms/WebBrowserMisc/CS/WebBrowserMisc.cs#30)]
[!code-vb[WebBrowserMisc#30](~/samples/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb#30)]
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.Document" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentStream" />
<altmember cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="DocumentTitle">
<MemberSignature Language="C#" Value="public string DocumentTitle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DocumentTitle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.DocumentTitle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DocumentTitle As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ DocumentTitle { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DocumentTitle : string" Usage="System.Windows.Forms.WebBrowser.DocumentTitle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the title of the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<value>The title of the current document, or the empty string ("") if no document is loaded.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property is useful, for example, when you want to display the document title in the title bar of the application. If no title has been defined for the current document, this property is set to the document location and file name.
Handle the <xref:System.Windows.Forms.WebBrowser.DocumentTitleChanged> event to update the title in the title bar when the <xref:System.Windows.Forms.WebBrowser> control navigates to a new document.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.DocumentTitle%2A> property to update the form title bar with the title of the current document. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#15](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#15)]
[!code-csharp[System.Windows.Forms.WebBrowser#15](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#15)]
[!code-vb[System.Windows.Forms.WebBrowser#15](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#15)]
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="E:System.Windows.Forms.WebBrowser.DocumentTitleChanged" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="DocumentTitleChanged">
<MemberSignature Language="C#" Value="public event EventHandler DocumentTitleChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler DocumentTitleChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.DocumentTitleChanged" />
<MemberSignature Language="VB.NET" Value="Public Event DocumentTitleChanged As EventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ DocumentTitleChanged;" />
<MemberSignature Language="F#" Value="member this.DocumentTitleChanged : EventHandler " Usage="member this.DocumentTitleChanged : System.EventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event DocumentTitleChanged As EventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="P:System.Windows.Forms.WebBrowser.DocumentTitle" /> property value changes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can handle this event to update the title bar of your application with the current value of the <xref:System.Windows.Forms.WebBrowser.DocumentTitle%2A> property.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.DocumentTitleChanged> event to update the form title bar with the title of the current document. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#15](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#15)]
[!code-csharp[System.Windows.Forms.WebBrowser#15](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#15)]
[!code-vb[System.Windows.Forms.WebBrowser#15](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#15)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentTitle" />
<altmember cref="T:System.EventArgs" />
<altmember cref="T:System.EventHandler" />
</Docs>
</Member>
<Member MemberName="DocumentType">
<MemberSignature Language="C#" Value="public string DocumentType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DocumentType" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.DocumentType" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DocumentType As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ DocumentType { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DocumentType : string" Usage="System.Windows.Forms.WebBrowser.DocumentType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the type of the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<value>The type of the current document.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The value of this property corresponds to the Multipurpose Internet Mail Extensions (MIME) type of the document.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="EncryptionLevel">
<MemberSignature Language="C#" Value="public System.Windows.Forms.WebBrowserEncryptionLevel EncryptionLevel { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Windows.Forms.WebBrowserEncryptionLevel EncryptionLevel" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.EncryptionLevel" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property EncryptionLevel As WebBrowserEncryptionLevel" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Windows::Forms::WebBrowserEncryptionLevel EncryptionLevel { System::Windows::Forms::WebBrowserEncryptionLevel get(); };" />
<MemberSignature Language="F#" Value="member this.EncryptionLevel : System.Windows.Forms.WebBrowserEncryptionLevel" Usage="System.Windows.Forms.WebBrowser.EncryptionLevel" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Windows.Forms.WebBrowserEncryptionLevel</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating the encryption method used by the document currently displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<value>One of the <see cref="T:System.Windows.Forms.WebBrowserEncryptionLevel" /> values.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property with the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. When the current document is not encrypted, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Insecure?displayProperty=nameWithType>. When the <xref:System.Windows.Forms.WebBrowser> control displays a Web page containing multiple frames with content of different encryption levels, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Mixed?displayProperty=nameWithType>. When the encryption level is unknown, the value of this property is <xref:System.Windows.Forms.WebBrowserEncryptionLevel.Unknown?displayProperty=nameWithType>. Other values indicate the type of encryption present. To mimic the behavior of the lock icon in Internet Explorer, display the encryption type in a ToolTip that appears when the mouse pointer hovers over the indicator.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="E:System.Windows.Forms.WebBrowser.EncryptionLevelChanged" />
<altmember cref="T:System.Windows.Forms.WebBrowserEncryptionLevel" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="EncryptionLevelChanged">
<MemberSignature Language="C#" Value="public event EventHandler EncryptionLevelChanged;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler EncryptionLevelChanged" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.EncryptionLevelChanged" />
<MemberSignature Language="VB.NET" Value="Public Event EncryptionLevelChanged As EventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ EncryptionLevelChanged;" />
<MemberSignature Language="F#" Value="member this.EncryptionLevelChanged : EventHandler " Usage="member this.EncryptionLevelChanged : System.EventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event EncryptionLevelChanged As EventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control navigates to or away from a Web site that uses encryption.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this event with the <xref:System.Windows.Forms.WebBrowser.EncryptionLevel%2A> property to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. In a handler for this event, check the value of the <xref:System.Windows.Forms.WebBrowser.EncryptionLevel%2A> property to determine whether you should hide or display the indicator. To mimic the behavior of the lock icon in Internet Explorer, you can also provide a ToolTip that shows the encryption level when the mouse pointer hovers over the indicator.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.EncryptionLevelChanged> event.
[!code-csharp[System.Windows.Forms.EventExamples#647](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#647)]
[!code-vb[System.Windows.Forms.EventExamples#647](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#647)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.EncryptionLevel" />
<altmember cref="T:System.EventArgs" />
<altmember cref="T:System.EventHandler" />
</Docs>
</Member>
<Member MemberName="FileDownload">
<MemberSignature Language="C#" Value="public event EventHandler FileDownload;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler FileDownload" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.FileDownload" />
<MemberSignature Language="VB.NET" Value="Public Event FileDownload As EventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ FileDownload;" />
<MemberSignature Language="F#" Value="member this.FileDownload : EventHandler " Usage="member this.FileDownload : System.EventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event FileDownload As EventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control downloads a file.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.FileDownload> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.FileDownload> event.
[!code-csharp[System.Windows.Forms.EventExamples#648](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#648)]
[!code-vb[System.Windows.Forms.EventExamples#648](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#648)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="T:System.ComponentModel.CancelEventArgs" />
<altmember cref="T:System.ComponentModel.CancelEventHandler" />
</Docs>
</Member>
<Member MemberName="Focused">
<MemberSignature Language="C#" Value="public override bool Focused { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Focused" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.Focused" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Focused As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool Focused { bool get(); };" />
<MemberSignature Language="F#" Value="member this.Focused : bool" Usage="System.Windows.Forms.WebBrowser.Focused" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the control or any of its child windows has input focus.</summary>
<value>
<see langword="true" /> if the control or any of its child windows has input focus; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding the <see cref="P:System.Windows.Forms.WebBrowser.Focused" /> property in a derived class, use the base class's <see cref="P:System.Windows.Forms.WebBrowser.Focused" /> property to extend the base implementation. Otherwise, you must provide all the implementation.</para>
</block>
</Docs>
</Member>
<Member MemberName="GoBack">
<MemberSignature Language="C#" Value="public bool GoBack ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool GoBack() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.GoBack" />
<MemberSignature Language="VB.NET" Value="Public Function GoBack () As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool GoBack();" />
<MemberSignature Language="F#" Value="member this.GoBack : unit -&gt; bool" Usage="webBrowser.GoBack " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Navigates the <see cref="T:System.Windows.Forms.WebBrowser" /> control to the previous page in the navigation history, if one is available.</summary>
<returns>
<see langword="true" /> if the navigation succeeds; <see langword="false" /> if a previous page in the navigation history is not available.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. You can use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to implement a **Back** button similar to the one in Internet Explorer, which will allow your users to return to a previous page in the navigation history.
Use the <xref:System.Windows.Forms.WebBrowser.CanGoBack%2A> property to determine whether the navigation history is available and contains a previous page. Handle the <xref:System.Windows.Forms.WebBrowser.CanGoBackChanged> event to receive a notification when the <xref:System.Windows.Forms.WebBrowser.CanGoBack%2A> property value changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the <xref:System.Windows.Forms.WebBrowser> control navigates to or leaves the beginning of the navigation history.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to implement a **Back** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `backButton`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#7](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#7)]
[!code-csharp[System.Windows.Forms.WebBrowser#7](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#7)]
[!code-vb[System.Windows.Forms.WebBrowser#7](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#7)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.CanGoBack" />
<altmember cref="E:System.Windows.Forms.WebBrowser.CanGoBackChanged" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoHome" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoSearch" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Stop" />
</Docs>
</Member>
<Member MemberName="GoForward">
<MemberSignature Language="C#" Value="public bool GoForward ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool GoForward() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.GoForward" />
<MemberSignature Language="VB.NET" Value="Public Function GoForward () As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; bool GoForward();" />
<MemberSignature Language="F#" Value="member this.GoForward : unit -&gt; bool" Usage="webBrowser.GoForward " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Navigates the <see cref="T:System.Windows.Forms.WebBrowser" /> control to the next page in the navigation history, if one is available.</summary>
<returns>
<see langword="true" /> if the navigation succeeds; <see langword="false" /> if a subsequent page in the navigation history is not available.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. You can use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to implement a **Forward** button similar to the one in Internet Explorer, allowing your users to return to the next page in the navigation history after navigating backward.
Use the <xref:System.Windows.Forms.WebBrowser.CanGoForward%2A> property to determine whether the navigation history is available and contains a page located after the current one. Handle the <xref:System.Windows.Forms.WebBrowser.CanGoForwardChanged> event to receive a notification when the <xref:System.Windows.Forms.WebBrowser.CanGoForward%2A> property value changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the <xref:System.Windows.Forms.WebBrowser> control navigates to or leaves the end of the navigation history.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to implement a **Forward** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonForward`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#8](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#8)]
[!code-csharp[System.Windows.Forms.WebBrowser#8](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#8)]
[!code-vb[System.Windows.Forms.WebBrowser#8](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#8)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.CanGoForward" />
<altmember cref="E:System.Windows.Forms.WebBrowser.CanGoForwardChanged" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoHome" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoSearch" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Stop" />
</Docs>
</Member>
<Member MemberName="GoHome">
<MemberSignature Language="C#" Value="public void GoHome ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void GoHome() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.GoHome" />
<MemberSignature Language="VB.NET" Value="Public Sub GoHome ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void GoHome();" />
<MemberSignature Language="F#" Value="member this.GoHome : unit -&gt; unit" Usage="webBrowser.GoHome " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Navigates the <see cref="T:System.Windows.Forms.WebBrowser" /> control to the home page of the current user.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this method to implement a **Home** button similar to the one in Internet Explorer. The user can specify a home page in the **Internet Options** dialog box, which is available from Control Panel or from the **Tools** menu in Internet Explorer.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoHome%2A> method to implement a **Home** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonHome`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#11](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#11)]
[!code-csharp[System.Windows.Forms.WebBrowser#11](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#11)]
[!code-vb[System.Windows.Forms.WebBrowser#11](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#11)]
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoSearch" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Stop" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="GoSearch">
<MemberSignature Language="C#" Value="public void GoSearch ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void GoSearch() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.GoSearch" />
<MemberSignature Language="VB.NET" Value="Public Sub GoSearch ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void GoSearch();" />
<MemberSignature Language="F#" Value="member this.GoSearch : unit -&gt; unit" Usage="webBrowser.GoSearch " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Navigates the <see cref="T:System.Windows.Forms.WebBrowser" /> control to the default search page of the current user.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this method to implement a search feature similar to the one in Internet Explorer. Depending on the version of Internet Explorer installed, the user can specify a default search page in the **Internet Options** dialog box, which is available from Control Panel or from the **Tools** menu in Internet Explorer.
The default search page is stored in the registry under the `HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Search Page` registry key. With later versions of Internet Explorer, this registry key must be modified in order to change the default search page used by this method. To use a search page other than the default, call the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method or specify the <xref:System.Windows.Forms.WebBrowser.Url%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.GoSearch%2A> method to implement a **Search** button for the <xref:System.Windows.Forms.WebBrowser> control similar to the one in Internet Explorer. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and a <xref:System.Windows.Forms.Button> control called `ButtonSearch`.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#12](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#12)]
[!code-csharp[System.Windows.Forms.WebBrowser#12](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#12)]
[!code-vb[System.Windows.Forms.WebBrowser#12](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#12)]
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoHome" />
<altmember cref="Overload:System.Windows.Forms.WebBrowser.Navigate" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Stop" />
<altmember cref="P:System.Windows.Forms.WebBrowser.Url" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="IsBusy">
<MemberSignature Language="C#" Value="public bool IsBusy { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsBusy" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.IsBusy" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsBusy As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsBusy { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsBusy : bool" Usage="System.Windows.Forms.WebBrowser.IsBusy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the <see cref="T:System.Windows.Forms.WebBrowser" /> control is currently loading a new document.</summary>
<value>
<see langword="true" /> if the control is busy loading a document; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If this property is `true`, you can use the <xref:System.Windows.Forms.WebBrowser.Stop%2A> method to halt the current navigation before the new document is fully loaded. Use the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property to determine the exact navigation state of the <xref:System.Windows.Forms.WebBrowser> control. The <xref:System.Windows.Forms.WebBrowser.IsBusy%2A> property value is false when the <xref:System.Windows.Forms.WebBrowser.ReadyState%2A> property value is <xref:System.Windows.Forms.WebBrowserReadyState.Complete?displayProperty=nameWithType>.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.ReadyState" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Stop" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="IsOffline">
<MemberSignature Language="C#" Value="public bool IsOffline { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsOffline" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.IsOffline" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsOffline As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsOffline { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsOffline : bool" Usage="System.Windows.Forms.WebBrowser.IsOffline" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the <see cref="T:System.Windows.Forms.WebBrowser" /> control is in offline mode.</summary>
<value>
<see langword="true" /> if the <see cref="T:System.Windows.Forms.WebBrowser" /> control is in offline mode; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In offline mode, the <xref:System.Windows.Forms.WebBrowser> control is forced to load Web pages from the local cache rather than downloading them.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="IsWebBrowserContextMenuEnabled">
<MemberSignature Language="C#" Value="public bool IsWebBrowserContextMenuEnabled { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsWebBrowserContextMenuEnabled" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled" />
<MemberSignature Language="VB.NET" Value="Public Property IsWebBrowserContextMenuEnabled As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IsWebBrowserContextMenuEnabled { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.IsWebBrowserContextMenuEnabled : bool with get, set" Usage="System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or a sets a value indicating whether the shortcut menu of the <see cref="T:System.Windows.Forms.WebBrowser" /> control is enabled.</summary>
<value>
<see langword="true" /> if the <see cref="T:System.Windows.Forms.WebBrowser" /> control shortcut menu is enabled; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
By default, the <xref:System.Windows.Forms.WebBrowser> control displays a shortcut menu when a user right-clicks it. This behavior is useful when you use the control as a generic browser. If you want to conceal the fact that you are using the <xref:System.Windows.Forms.WebBrowser> control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls, set the <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> property to false.
You can disable other standard browser features by setting the <xref:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop%2A> and <xref:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled%2A> properties to false.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> property.
[!code-csharp[System.Windows.Forms.WebBrowser.ObjectForScripting#2](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/CS/form1.cs#2)]
[!code-vb[System.Windows.Forms.WebBrowser.ObjectForScripting#2](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb#2)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.AllowWebBrowserDrop" />
<altmember cref="P:System.Windows.Forms.WebBrowser.WebBrowserShortcutsEnabled" />
</Docs>
</Member>
<MemberGroup MemberName="Navigate">
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Loads the document at the specified location into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (string urlString);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(string urlString) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (urlString As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(System::String ^ urlString);" />
<MemberSignature Language="F#" Value="member this.Navigate : string -&gt; unit" Usage="webBrowser.Navigate urlString" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="urlString" Type="System.String" />
</Parameters>
<Docs>
<param name="urlString">The URL of the document to load.</param>
<summary>Loads the document at the specified Uniform Resource Locator (URL) into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the previous document.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control navigates to the specified URI and adds it to the end of the history list. Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version.
You can use the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method to implement an address bar similar to the one in Internet Explorer.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (Uri url);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(class System.Uri url) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.Uri)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (url As Uri)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(Uri ^ url);" />
<MemberSignature Language="F#" Value="member this.Navigate : Uri -&gt; unit" Usage="webBrowser.Navigate url" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.Uri" />
</Parameters>
<Docs>
<param name="url">A <see cref="T:System.Uri" /> representing the URL of the document to load.</param>
<summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the previous document.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control navigates to the specified URI and adds it to the end of the history list. Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version.
You can use the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method to implement an address bar similar to the one in Internet Explorer.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method to implement an address bar for the <xref:System.Windows.Forms.WebBrowser> control. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#6](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#6)]
[!code-csharp[System.Windows.Forms.WebBrowser#6](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#6)]
[!code-vb[System.Windows.Forms.WebBrowser#6](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#6)]
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="url" /> parameter value does not represent an absolute URI. For more information, see <see cref="P:System.Uri.IsAbsoluteUri" />.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (string urlString, bool newWindow);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(string urlString, bool newWindow) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (urlString As String, newWindow As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(System::String ^ urlString, bool newWindow);" />
<MemberSignature Language="F#" Value="member this.Navigate : string * bool -&gt; unit" Usage="webBrowser.Navigate (urlString, newWindow)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="urlString" Type="System.String" />
<Parameter Name="newWindow" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="urlString">The URL of the document to load.</param>
<param name="newWindow">
<see langword="true" /> to load the document into a new browser window; <see langword="false" /> to load the document into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</param>
<summary>Loads the document at the specified Uniform Resource Locator (URL) into a new browser window or into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the <xref:System.Windows.Forms.WebBrowser.NewWindow> event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="E:System.Windows.Forms.WebBrowser.NewWindow" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (string urlString, string targetFrameName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(string urlString, string targetFrameName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (urlString As String, targetFrameName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(System::String ^ urlString, System::String ^ targetFrameName);" />
<MemberSignature Language="F#" Value="member this.Navigate : string * string -&gt; unit" Usage="webBrowser.Navigate (urlString, targetFrameName)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="urlString" Type="System.String" />
<Parameter Name="targetFrameName" Type="System.String" />
</Parameters>
<Docs>
<param name="urlString">The URL of the document to load.</param>
<param name="targetFrameName">The name of the frame in which to load the document.</param>
<summary>Loads the document at the specified Uniform Resource Locator (URL) into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the contents of the Web page frame with the specified name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window.
Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (Uri url, bool newWindow);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(class System.Uri url, bool newWindow) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.Uri,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (url As Uri, newWindow As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(Uri ^ url, bool newWindow);" />
<MemberSignature Language="F#" Value="member this.Navigate : Uri * bool -&gt; unit" Usage="webBrowser.Navigate (url, newWindow)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.Uri" />
<Parameter Name="newWindow" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="url">A <see cref="T:System.Uri" /> representing the URL of the document to load.</param>
<param name="newWindow">
<see langword="true" /> to load the document into a new browser window; <see langword="false" /> to load the document into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</param>
<summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into a new browser window or into the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the <xref:System.Windows.Forms.WebBrowser.NewWindow> event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="url" /> parameter value does not represent an absolute URI. For more information, see <see cref="P:System.Uri.IsAbsoluteUri" />.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="E:System.Windows.Forms.WebBrowser.NewWindow" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (Uri url, string targetFrameName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(class System.Uri url, string targetFrameName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.Uri,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (url As Uri, targetFrameName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(Uri ^ url, System::String ^ targetFrameName);" />
<MemberSignature Language="F#" Value="member this.Navigate : Uri * string -&gt; unit" Usage="webBrowser.Navigate (url, targetFrameName)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.Uri" />
<Parameter Name="targetFrameName" Type="System.String" />
</Parameters>
<Docs>
<param name="url">A <see cref="T:System.Uri" /> representing the URL of the document to load.</param>
<param name="targetFrameName">The name of the frame in which to load the document.</param>
<summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, replacing the contents of the Web page frame with the specified name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window.
Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="url" /> parameter value does not represent an absolute URI. For more information, see <see cref="P:System.Uri.IsAbsoluteUri" />.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (string urlString, string targetFrameName, byte[] postData, string additionalHeaders);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(string urlString, string targetFrameName, unsigned int8[] postData, string additionalHeaders) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.String,System.String,System.Byte[],System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (urlString As String, targetFrameName As String, postData As Byte(), additionalHeaders As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(System::String ^ urlString, System::String ^ targetFrameName, cli::array &lt;System::Byte&gt; ^ postData, System::String ^ additionalHeaders);" />
<MemberSignature Language="F#" Value="member this.Navigate : string * string * byte[] * string -&gt; unit" Usage="webBrowser.Navigate (urlString, targetFrameName, postData, additionalHeaders)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="urlString" Type="System.String" />
<Parameter Name="targetFrameName" Type="System.String" />
<Parameter Name="postData" Type="System.Byte[]" />
<Parameter Name="additionalHeaders" Type="System.String" />
</Parameters>
<Docs>
<param name="urlString">The URL of the document to load.</param>
<param name="targetFrameName">The name of the frame in which to load the document.</param>
<param name="postData">HTTP POST data such as form data.</param>
<param name="additionalHeaders">HTTP headers to add to the default headers.</param>
<summary>Loads the document at the specified Uniform Resource Locator (URL) into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, requesting it using the specified HTTP data and replacing the contents of the Web page frame with the specified name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window.
Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigate">
<MemberSignature Language="C#" Value="public void Navigate (Uri url, string targetFrameName, byte[] postData, string additionalHeaders);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Navigate(class System.Uri url, string targetFrameName, unsigned int8[] postData, string additionalHeaders) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.Navigate(System.Uri,System.String,System.Byte[],System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Navigate (url As Uri, targetFrameName As String, postData As Byte(), additionalHeaders As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Navigate(Uri ^ url, System::String ^ targetFrameName, cli::array &lt;System::Byte&gt; ^ postData, System::String ^ additionalHeaders);" />
<MemberSignature Language="F#" Value="member this.Navigate : Uri * string * byte[] * string -&gt; unit" Usage="webBrowser.Navigate (url, targetFrameName, postData, additionalHeaders)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="url" Type="System.Uri" />
<Parameter Name="targetFrameName" Type="System.String" />
<Parameter Name="postData" Type="System.Byte[]" />
<Parameter Name="additionalHeaders" Type="System.String" />
</Parameters>
<Docs>
<param name="url">A <see cref="T:System.Uri" /> representing the URL of the document to load.</param>
<param name="targetFrameName">The name of the frame in which to load the document.</param>
<param name="postData">HTTP POST data such as form data.</param>
<param name="additionalHeaders">HTTP headers to add to the default headers.</param>
<summary>Loads the document at the location indicated by the specified <see cref="T:System.Uri" /> into the <see cref="T:System.Windows.Forms.WebBrowser" /> control, requesting it using the specified HTTP data and replacing the contents of the Web page frame with the specified name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the <xref:System.Windows.Forms.WebBrowser> control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window.
Use the <xref:System.Windows.Forms.WebBrowser.GoBack%2A> method to return the control to a previous page in the navigation history. Use the <xref:System.Windows.Forms.WebBrowser.GoForward%2A> method to return to a later page in the navigation history after navigating backward.
The <xref:System.Windows.Forms.WebBrowser> control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the <xref:System.Windows.Forms.WebBrowser.Refresh%2A> method to force the <xref:System.Windows.Forms.WebBrowser> control to reload the current page by downloading it, ensuring that the control displays the latest version.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="url" /> parameter value does not represent an absolute URI. For more information, see <see cref="P:System.Uri.IsAbsoluteUri" />.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.Refresh" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="Navigated">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.WebBrowserNavigatedEventHandler Navigated;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.WebBrowserNavigatedEventHandler Navigated" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.Navigated" />
<MemberSignature Language="VB.NET" Value="Public Event Navigated As WebBrowserNavigatedEventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::WebBrowserNavigatedEventHandler ^ Navigated;" />
<MemberSignature Language="F#" Value="member this.Navigated : System.Windows.Forms.WebBrowserNavigatedEventHandler " Usage="member this.Navigated : System.Windows.Forms.WebBrowserNavigatedEventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event Navigated As WebBrowserNavigatedEventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.WebBrowserNavigatedEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the <see cref="T:System.Windows.Forms.WebBrowser" /> control has navigated to a new document and has begun loading it.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control navigates to a new document whenever one of the following properties is set or methods is called:
- <xref:System.Windows.Forms.WebBrowser.Url%2A>
- <xref:System.Windows.Forms.WebBrowser.DocumentText%2A>
- <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A>
- <xref:System.Windows.Forms.WebBrowser.Navigate%2A>
- <xref:System.Windows.Forms.WebBrowser.GoBack%2A>
- <xref:System.Windows.Forms.WebBrowser.GoForward%2A>
- <xref:System.Windows.Forms.WebBrowser.GoHome%2A>
- <xref:System.Windows.Forms.WebBrowser.GoSearch%2A>
Handle the <xref:System.Windows.Forms.WebBrowser.Navigated> event to receive notification when the <xref:System.Windows.Forms.WebBrowser> control has navigated to a new document. When the <xref:System.Windows.Forms.WebBrowser.Navigated> event occurs, the new document has begun loading, which means you can access the loaded content through the <xref:System.Windows.Forms.WebBrowser.Document%2A>, <xref:System.Windows.Forms.WebBrowser.DocumentText%2A>, and <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A> properties. Handle the <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event to receive notification when the <xref:System.Windows.Forms.WebBrowser> control finishes loading the new document.
You can also receive notification before navigation begins by handling the <xref:System.Windows.Forms.WebBrowser.Navigating> event. Handling this event lets you cancel navigation if certain conditions have not been met, for example, the user has not completely filled out a form.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.Navigated> event to implement an address bar for the <xref:System.Windows.Forms.WebBrowser> control. This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1`, a <xref:System.Windows.Forms.TextBox> control called `TextBoxAddress`, and a <xref:System.Windows.Forms.Button> control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the <xref:System.Windows.Forms.WebBrowser> control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL.
For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-cpp[System.Windows.Forms.WebBrowser#6](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp#6)]
[!code-csharp[System.Windows.Forms.WebBrowser#6](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CS/form1.cs#6)]
[!code-vb[System.Windows.Forms.WebBrowser#6](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb#6)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentStream" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentText" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoHome" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoSearch" />
<altmember cref="Overload:System.Windows.Forms.WebBrowser.Navigate" />
<altmember cref="E:System.Windows.Forms.WebBrowser.Navigating" />
<altmember cref="P:System.Windows.Forms.WebBrowser.Url" />
<altmember cref="T:System.Windows.Forms.WebBrowserNavigatedEventArgs" />
<altmember cref="T:System.Windows.Forms.WebBrowserNavigatedEventHandler" />
</Docs>
</Member>
<Member MemberName="Navigating">
<MemberSignature Language="C#" Value="public event System.Windows.Forms.WebBrowserNavigatingEventHandler Navigating;" />
<MemberSignature Language="ILAsm" Value=".event class System.Windows.Forms.WebBrowserNavigatingEventHandler Navigating" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.Navigating" />
<MemberSignature Language="VB.NET" Value="Public Event Navigating As WebBrowserNavigatingEventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::Windows::Forms::WebBrowserNavigatingEventHandler ^ Navigating;" />
<MemberSignature Language="F#" Value="member this.Navigating : System.Windows.Forms.WebBrowserNavigatingEventHandler " Usage="member this.Navigating : System.Windows.Forms.WebBrowserNavigatingEventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event Navigating As WebBrowserNavigatingEventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Forms.WebBrowserNavigatingEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs before the <see cref="T:System.Windows.Forms.WebBrowser" /> control navigates to a new document.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control navigates to a new document whenever one of the following properties is set or methods is called:
- <xref:System.Windows.Forms.WebBrowser.Url%2A>
- <xref:System.Windows.Forms.WebBrowser.DocumentText%2A>
- <xref:System.Windows.Forms.WebBrowser.DocumentStream%2A>
- <xref:System.Windows.Forms.WebBrowser.Navigate%2A>
- <xref:System.Windows.Forms.WebBrowser.GoBack%2A>
- <xref:System.Windows.Forms.WebBrowser.GoForward%2A>
- <xref:System.Windows.Forms.WebBrowser.GoHome%2A>
- <xref:System.Windows.Forms.WebBrowser.GoSearch%2A>
You can handle the <xref:System.Windows.Forms.WebBrowser.Navigating> event to cancel navigation if certain conditions have not been met, for example, when the user has not completely filled out a form. To cancel navigation, set the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property of the <xref:System.Windows.Forms.WebBrowserNavigatingEventArgs> object passed to the event handler to `true`. You can also use this object to retrieve the URL of the new document through the <xref:System.Windows.Forms.WebBrowserNavigatingEventArgs.Url%2A?displayProperty=nameWithType> property. If the new document will be displayed in a Web page frame, you can retrieve the name of the frame through the <xref:System.Windows.Forms.WebBrowserNavigatingEventArgs.TargetFrameName%2A?displayProperty=nameWithType> property.
Handle the <xref:System.Windows.Forms.WebBrowser.Navigated> event to receive notification when the <xref:System.Windows.Forms.WebBrowser> control finishes navigation and has begun loading the document at the new location. Handle the <xref:System.Windows.Forms.WebBrowser.DocumentCompleted> event to receive notification when the <xref:System.Windows.Forms.WebBrowser> control finishes loading the new document.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates how to use a handler for the <xref:System.Windows.Forms.WebBrowser.Navigating> event to cancel navigation when a Web page form has not been filled in. The <xref:System.Windows.Forms.WebBrowser.Document%2A> property is used to determine whether the form input field contains a value.
This example requires that your form contains a <xref:System.Windows.Forms.WebBrowser> control called `webBrowser1` and that your form class has a <xref:System.Runtime.InteropServices.ComVisibleAttribute> making it accessible to COM.
For a complete code example that you can paste the following code into, see [How to: Add Web Browser Capabilities to a Windows Forms Application](~/docs/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application.md).
[!code-csharp[WebBrowserMisc#30](~/samples/snippets/csharp/VS_Snippets_Winforms/WebBrowserMisc/CS/WebBrowserMisc.cs#30)]
[!code-vb[WebBrowserMisc#30](~/samples/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb#30)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentStream" />
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentText" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoBack" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoForward" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoHome" />
<altmember cref="M:System.Windows.Forms.WebBrowser.GoSearch" />
<altmember cref="Overload:System.Windows.Forms.WebBrowser.Navigate" />
<altmember cref="E:System.Windows.Forms.WebBrowser.Navigated" />
<altmember cref="P:System.Windows.Forms.WebBrowser.Url" />
<altmember cref="T:System.Windows.Forms.WebBrowserNavigatingEventArgs" />
<altmember cref="T:System.Windows.Forms.WebBrowserNavigatingEventHandler" />
</Docs>
</Member>
<Member MemberName="NewWindow">
<MemberSignature Language="C#" Value="public event System.ComponentModel.CancelEventHandler NewWindow;" />
<MemberSignature Language="ILAsm" Value=".event class System.ComponentModel.CancelEventHandler NewWindow" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.WebBrowser.NewWindow" />
<MemberSignature Language="VB.NET" Value="Public Event NewWindow As CancelEventHandler " FrameworkAlternate="netcore-3.0;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event System::ComponentModel::CancelEventHandler ^ NewWindow;" />
<MemberSignature Language="F#" Value="member this.NewWindow : System.ComponentModel.CancelEventHandler " Usage="member this.NewWindow : System.ComponentModel.CancelEventHandler " />
<MemberSignature Language="VB.NET" Value="Public Custom Event NewWindow As CancelEventHandler " FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2" />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ComponentModel.CancelEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs before a new browser window is opened.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.WebBrowser> control opens a separate browser window when the appropriate overload of the <xref:System.Windows.Forms.WebBrowser.Navigate%2A> method is called or when the user clicks the **Open in New Window** option of the browser shortcut menu when the mouse pointer hovers over a hyperlink. You can disable the shortcut menu by setting the <xref:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled%2A> property to false.
The <xref:System.Windows.Forms.WebBrowser.NewWindow> event occurs before the new browser window is opened. You can handle this event, for example, to prevent the window from opening when certain conditions have not been met.
For more information about handling events, see [Handling and Raising Events](~/docs/standard/events/index.md).
## Examples
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.WebBrowser.NewWindow> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.
To run the example code, paste it into a project that contains an instance of type <xref:System.Windows.Forms.WebBrowser> named `WebBrowser1`. Then ensure that the event handler is associated with the <xref:System.Windows.Forms.WebBrowser.NewWindow> event.
[!code-csharp[System.Windows.Forms.EventExamples#651](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/CS/EventExamples.cs#651)]
[!code-vb[System.Windows.Forms.EventExamples#651](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb#651)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="T:System.ComponentModel.CancelEventArgs" />
<altmember cref="T:System.ComponentModel.CancelEventHandler" />
<altmember cref="P:System.Windows.Forms.WebBrowser.IsWebBrowserContextMenuEnabled" />
<altmember cref="Overload:System.Windows.Forms.WebBrowser.Navigate" />
</Docs>
</Member>
<Member MemberName="ObjectForScripting">
<MemberSignature Language="C#" Value="public object ObjectForScripting { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object ObjectForScripting" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.WebBrowser.ObjectForScripting" />
<MemberSignature Language="VB.NET" Value="Public Property ObjectForScripting As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ ObjectForScripting { System::Object ^ get(); void set(System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.ObjectForScripting : obj with get, set" Usage="System.Windows.Forms.WebBrowser.ObjectForScripting" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an object that can be accessed by scripting code that is contained within a Web page displayed in the <see cref="T:System.Windows.Forms.WebBrowser" /> control.</summary>
<value>The object being made available to the scripting code.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this property to enable communication between a Web page hosted by the <xref:System.Windows.Forms.WebBrowser> control and the application that contains the <xref:System.Windows.Forms.WebBrowser> control. This property lets you integrate dynamic HTML (DHTML) code with your client application code. The object specified for this property is available to Web page script as the `window.external` object, which is a built-in DOM object provided for host access.
You can set this property to any COM-visible object for which you want its public properties and methods available to scripting code. You can make a class COM-visible by marking it with the <xref:System.Runtime.InteropServices.ComVisibleAttribute>.
To call functions defined in your Web page from your client application code, use the <xref:System.Windows.Forms.HtmlDocument.InvokeScript%2A?displayProperty=nameWithType> method of the <xref:System.Windows.Forms.HtmlDocument> object you can retrieve from the <xref:System.Windows.Forms.WebBrowser.Document%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property. In the example, the <xref:System.Windows.Forms.WebBrowser.ObjectForScripting%2A> property is set to the current form.
[!code-csharp[System.Windows.Forms.WebBrowser.ObjectForScripting#0](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/CS/form1.cs#0)]
[!code-vb[System.Windows.Forms.WebBrowser.ObjectForScripting#0](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb#0)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The specified value when setting this property is an instance of a non-public type.
-or-
The specified value when setting this property is an instance of a type that is not COM-visible. For more information, see <see cref="M:System.Runtime.InteropServices.Marshal.IsTypeVisibleFromCom(System.Type)" />.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<altmember cref="P:System.Windows.Forms.WebBrowser.Document" />
<altmember cref="M:System.Windows.Forms.HtmlDocument.InvokeScript(System.String,System.Object[])" />
</Docs>
</Member>
<Member MemberName="OnCanGoBackChanged">
<MemberSignature Language="C#" Value="protected virtual void OnCanGoBackChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnCanGoBackChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnCanGoBackChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnCanGoBackChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnCanGoBackChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnCanGoBackChanged : EventArgs -&gt; unit&#xA;override this.OnCanGoBackChanged : EventArgs -&gt; unit" Usage="webBrowser.OnCanGoBackChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" />
</Parameters>
<Docs>
<param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.CanGoBackChanged" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.WebBrowser.OnCanGoBackChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.WebBrowser.OnCanGoBackChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.WebBrowser.OnCanGoBackChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="P:System.Windows.Forms.WebBrowser.CanGoBack" />
<altmember cref="E:System.Windows.Forms.WebBrowser.CanGoBackChanged" />
</Docs>
</Member>
<Member MemberName="OnCanGoForwardChanged">
<MemberSignature Language="C#" Value="protected virtual void OnCanGoForwardChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnCanGoForwardChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnCanGoForwardChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnCanGoForwardChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnCanGoForwardChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnCanGoForwardChanged : EventArgs -&gt; unit&#xA;override this.OnCanGoForwardChanged : EventArgs -&gt; unit" Usage="webBrowser.OnCanGoForwardChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" />
</Parameters>
<Docs>
<param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.CanGoForwardChanged" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.WebBrowser.OnCanGoForwardChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.WebBrowser.OnCanGoForwardChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.WebBrowser.OnCanGoForwardChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="P:System.Windows.Forms.WebBrowser.CanGoForward" />
<altmember cref="E:System.Windows.Forms.WebBrowser.CanGoForwardChanged" />
</Docs>
</Member>
<Member MemberName="OnDocumentCompleted">
<MemberSignature Language="C#" Value="protected virtual void OnDocumentCompleted (System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnDocumentCompleted(class System.Windows.Forms.WebBrowserDocumentCompletedEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnDocumentCompleted(System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnDocumentCompleted (e As WebBrowserDocumentCompletedEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnDocumentCompleted(System::Windows::Forms::WebBrowserDocumentCompletedEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnDocumentCompleted : System.Windows.Forms.WebBrowserDocumentCompletedEventArgs -&gt; unit&#xA;override this.OnDocumentCompleted : System.Windows.Forms.WebBrowserDocumentCompletedEventArgs -&gt; unit" Usage="webBrowser.OnDocumentCompleted e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.WebBrowserDocumentCompletedEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.WebBrowserDocumentCompletedEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.WebBrowser.OnDocumentCompleted%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">This <see cref="T:System.Windows.Forms.WebBrowser" /> instance is no longer valid.</exception>
<exception cref="T:System.InvalidOperationException">A reference to an implementation of the <see langword="IWebBrowser2" /> interface could not be retrieved from the underlying ActiveX <see langword="WebBrowser" /> control.</exception>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.WebBrowser.OnDocumentCompleted(System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.WebBrowser.OnDocumentCompleted(System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.WebBrowser.DocumentCompleted" />
<altmember cref="T:System.Windows.Forms.WebBrowserDocumentCompletedEventArgs" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151478">WebBrowser Control</related>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkId=151479">IWebBrowser2 Interface</related>
</Docs>
</Member>
<Member MemberName="OnDocumentTitleChanged">
<MemberSignature Language="C#" Value="protected virtual void OnDocumentTitleChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnDocumentTitleChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnDocumentTitleChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnDocumentTitleChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnDocumentTitleChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnDocumentTitleChanged : EventArgs -&gt; unit&#xA;override this.OnDocumentTitleChanged : EventArgs -&gt; unit" Usage="webBrowser.OnDocumentTitleChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" />
</Parameters>
<Docs>
<param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.DocumentTitleChanged" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.WebBrowser.OnDocumentTitleChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.WebBrowser.OnDocumentTitleChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.WebBrowser.OnDocumentTitleChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="P:System.Windows.Forms.WebBrowser.DocumentTitle" />
<altmember cref="E:System.Windows.Forms.WebBrowser.DocumentTitleChanged" />
</Docs>
</Member>
<Member MemberName="OnEncryptionLevelChanged">
<MemberSignature Language="C#" Value="protected virtual void OnEncryptionLevelChanged (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnEncryptionLevelChanged(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnEncryptionLevelChanged(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnEncryptionLevelChanged (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnEncryptionLevelChanged(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnEncryptionLevelChanged : EventArgs -&gt; unit&#xA;override this.OnEncryptionLevelChanged : EventArgs -&gt; unit" Usage="webBrowser.OnEncryptionLevelChanged e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" />
</Parameters>
<Docs>
<param name="e">An <see cref="T:System.EventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.EncryptionLevelChanged" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.WebBrowser.OnEncryptionLevelChanged%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.WebBrowser.OnEncryptionLevelChanged(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.WebBrowser.OnEncryptionLevelChanged(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="P:System.Windows.Forms.WebBrowser.EncryptionLevel" />
<altmember cref="E:System.Windows.Forms.WebBrowser.EncryptionLevelChanged" />
</Docs>
</Member>
<Member MemberName="OnFileDownload">
<MemberSignature Language="C#" Value="protected virtual void OnFileDownload (EventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnFileDownload(class System.EventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnFileDownload(System.EventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnFileDownload (e As EventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnFileDownload(EventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnFileDownload : EventArgs -&gt; unit&#xA;override this.OnFileDownload : EventArgs -&gt; unit" Usage="webBrowser.OnFileDownload e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.EventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.FileDownload" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.WebBrowser.OnFileDownload%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.WebBrowser.OnFileDownload(System.EventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.WebBrowser.OnFileDownload(System.EventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.WebBrowser.FileDownload" />
</Docs>
</Member>
<Member MemberName="OnNavigated">
<MemberSignature Language="C#" Value="protected virtual void OnNavigated (System.Windows.Forms.WebBrowserNavigatedEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnNavigated(class System.Windows.Forms.WebBrowserNavigatedEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnNavigated(System.Windows.Forms.WebBrowserNavigatedEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnNavigated (e As WebBrowserNavigatedEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnNavigated(System::Windows::Forms::WebBrowserNavigatedEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnNavigated : System.Windows.Forms.WebBrowserNavigatedEventArgs -&gt; unit&#xA;override this.OnNavigated : System.Windows.Forms.WebBrowserNavigatedEventArgs -&gt; unit" Usage="webBrowser.OnNavigated e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Forms.WebBrowserNavigatedEventArgs" />
</Parameters>
<Docs>
<param name="e">A <see cref="T:System.Windows.Forms.WebBrowserNavigatedEventArgs" /> that contains the event data.</param>
<summary>Raises the <see cref="E:System.Windows.Forms.WebBrowser.Navigated" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](~/docs/standard/events/index.md).
The <xref:System.Windows.Forms.WebBrowser.OnNavigated%2A> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.SecurityPermission">for immediate callers to use this control. Demand value: <see cref="F:System.Security.Permissions.SecurityAction.LinkDemand" />; <see href="https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/4652tyx7(v=vs.100)">Named Permission Sets</see>: <see langword="FullTrust" />.</permission>
<block subset="none" type="overrides">
<para>When overriding <see cref="M:System.Windows.Forms.WebBrowser.OnNavigated(System.Windows.Forms.WebBrowserNavigatedEventArgs)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.WebBrowser.OnNavigated(System.Windows.Forms.WebBrowserNavigatedEventArgs)" /> method so that registered delegates receive the event.</para>
</block>
<altmember cref="E:System.Windows.Forms.WebBrowser.Navigated" />
<altmember cref="T:System.Windows.Forms.WebBrowserNavigatedEventArgs" />
</Docs>
</Member>
<Member MemberName="OnNavigating">
<MemberSignature Language="C#" Value="protected virtual void OnNavigating (System.Windows.Forms.WebBrowserNavigatingEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnNavigating(class System.Windows.Forms.WebBrowserNavigatingEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.WebBrowser.OnNavigating(System.Windows.Forms.WebBrowserNavigatingEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub OnNavigating (e As WebBrowserNavigatingEventArgs)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void OnNavigating(System::Windows::Forms::WebBrowserNavigatingEventArgs ^ e);" />
<MemberSignature Language="F#" Value="abstract member OnNavigating : System.Windows.Forms.WebBrowserNavigatingEventArgs -&gt; unit&#xA;override this.OnNavigating : System.Windows.Forms.WebBrowserNavigatingEventArgs -&gt; unit" Usage="webBrowser.OnNavigating e" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>