WebBrowser.Stop 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
取消任何挂起的导航并停止任何动态页面元素,例如背景声音和动画。
public:
void Stop();
public void Stop();
member this.Stop : unit -> unit
Public Sub Stop ()
示例
下面的代码示例演示如何使用 Stop 方法为 控件实现类似于 Internet Explorer 中的 WebBrowser 按钮。 此示例要求窗体包含一个 WebBrowser 调用 webBrowser1 的控件和一个名为 Button 的 ButtonStop控件。
有关完整的代码示例,请参阅 How to: Add Web Browser Capabilities to a Windows 窗体 Application。
// 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 File 菜单上的 Stop 按钮。