WebBrowserArray.NewWindow 事件


發生於開啟新瀏覽器視窗之前。Occurs before a new browser window is opened.

 event System::ComponentModel::CancelEventHandler ^ NewWindow;
public event System.ComponentModel.CancelEventHandler NewWindow;
member this.NewWindow : System.ComponentModel.CancelEventHandler 
Public Event NewWindow As CancelEventHandler 


當滑鼠指標停留在超連結上方時,WebBrowser 控制項會在呼叫 Navigate 方法的適當多載時,或當使用者按一下瀏覽器快捷方式功能表的 [在新視窗中開啟] 時,開啟另一個瀏覽器視窗。The WebBrowser control opens a separate browser window when the appropriate overload of the Navigate method is called or when the user clicks Open in New Window on the browser shortcut menu when the mouse pointer hovers over a hyperlink. 您可以將 [IsWebBrowserContextMenuEnabled] 屬性設定為 [false],以停用快捷方式功能表。You can disable the shortcut menu by setting the IsWebBrowserContextMenuEnabled property to false.

在開啟新的瀏覽器視窗之前,會發生 NewWindow 事件。The 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 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.