下面的代码示例演示如何将 WebBrowser 控件导航到特定 URL。
若要确定新文档何时完全加载,请处理该 DocumentCompleted 事件。 有关此事件的演示,请参阅 How to: Print with a WebBrowser Control.
示例:
Me.webBrowser1.Navigate("https://www.microsoft.com")
this.webBrowser1.Navigate("https://www.microsoft.com");
编译代码
此示例需要:
名为 WebBrowser 的
webBrowser1
控件。对
System
和System.Windows.Forms
程序集的引用。