Redigera

Dela via


WebBrowserArray.Navigating Event

Definition

Occurs before the WebBrowser control navigates to a new document.

public:
 event System::Windows::Forms::WebBrowserNavigatingEventHandler ^ Navigating;
public event System.Windows.Forms.WebBrowserNavigatingEventHandler Navigating;
member this.Navigating : System.Windows.Forms.WebBrowserNavigatingEventHandler 
Public Custom Event Navigating As WebBrowserNavigatingEventHandler 
Public Event Navigating As WebBrowserNavigatingEventHandler 

Event Type

Remarks

The WebBrowser control navigates to a new document whenever one of the following properties is set or methods is called:

You can handle the 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 Cancel property of the 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 Url property. If the new document will be displayed in a Web page frame, you can retrieve the name of the frame through the TargetFrameName property.

Handle the Navigated event to receive notification when the WebBrowser control finishes navigation and has begun loading the document at the new location. Handle the DocumentCompleted event to receive notification when the WebBrowser control finishes loading the new document.

For more information about how to handle events, see Handling and Raising Events.

Note

Functions and objects in the Microsoft.VisualBasic.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Applies to