WebBrowserArray.DocumentCompleted 事件


發生於 WebBrowser 控制項完成文件的載入時。Occurs when the WebBrowser control finishes loading a document.

 event System::Windows::Forms::WebBrowserDocumentCompletedEventHandler ^ DocumentCompleted;
public event System.Windows.Forms.WebBrowserDocumentCompletedEventHandler DocumentCompleted;
member this.DocumentCompleted : System.Windows.Forms.WebBrowserDocumentCompletedEventHandler 
Public Event DocumentCompleted As WebBrowserDocumentCompletedEventHandler 


每當設定下列其中一個屬性或呼叫方法時,WebBrowser 控制項會流覽至新的檔:The WebBrowser control navigates to a new document whenever one of the following properties is set or methods is called:

處理 DocumentCompleted 事件,以在新檔完成載入時收到通知。Handle the DocumentCompleted event to receive notification when the new document finishes loading. 當發生 DocumentCompleted 事件時,就會完整載入新檔,這表示您可以透過 DocumentDocumentTextDocumentStream 屬性來存取其內容。When the DocumentCompleted event occurs, the new document is fully loaded, which means you can access its contents through the Document, DocumentText, or DocumentStream property.

若要在導覽開始前收到通知,請處理 Navigating 事件。To receive notification before navigation starts, handle the 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. 處理 Navigated 事件,以在 WebBrowser 控制項完成導覽並于新位置開始載入檔時,接收通知。Handle the Navigated event to receive notification when the WebBrowser control finishes navigation and has begun loading the document at the new location.

如需如何處理事件的詳細資訊,請參閱處理和引發事件For more information about how to handle events, see Handling and Raising Events.


Microsoft.VisualBasic.Compatibility.VB6 命名空間中的函式和物件都是供這些工具使用,以便從 Visual Basic 6.0 升級至 Visual Basic。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. 在大多數情況下,這些函式和物件會複製在 .NET Framework.NET Framework 的其他命名空間中可以找到的功能。In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework.NET Framework. 只有當 Visual Basic 6.0 程式碼模型與 .NET Framework.NET Framework 實作有顯著差異時,才需要這些項目。They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework.NET Framework implementation.