WebBrowser.Stop 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
取消所有挂起的导航并停止所有动态页元素(如背景声音和动画)。
public:
void Stop();
public void Stop();
member this.Stop : unit -> unit
Public Sub Stop ()
下面的代码示例演示如何使用 Stop 方法实现控件的WebBrowser“停止”按钮,类似于 Internet Explorer 中的按钮。 此示例要求窗体包含名为 WebBrowser 的 webBrowser1
控件和 Button 名为 的 ButtonStop
控件。
有关完整的代码示例,请参阅如何:向Windows 窗体应用程序添加 Web 浏览器功能。
// Halts the current navigation and any sounds or animations on
// the page.
void ButtonStop_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
this->WebBrowser1->Stop();
}
// Halts the current navigation and any sounds or animations on
// the page.
private void stopButton_Click(object sender, EventArgs e)
{
webBrowser1.Stop();
}
' Halts the current navigation and any sounds or animations on
' the page.
Private Sub stopButton_Click( _
ByVal sender As Object, ByVal e As EventArgs) _
Handles stopButton.Click
webBrowser1.Stop()
End Sub
可以使用 Stop 方法实现类似于 Internet Explorer“文件”菜单上的“停止”按钮。
产品 | 版本 |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |