HtmlWindow::Close Method ()

 

Closes the window.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
void Close()

Use the IsClosed property to determine if the window is already closed. If the window is already closed, this method will have no effect.

When you create new windows using Open or OpenNew, Close causes the HTML Document Object Model to open a new instance of Internet Explorer. If you do not call Close on all of the windows you have created, this instance of Internet Explorer will remain running even after your application closes.

The following code example opens a window, and closes it if the user has not used it in the past five minutes. The code example was written under the assumption that your form has a WebBrowser control named WebBrowser1, a Button named Button1, and a Timer class named Timer1. To run this example successfully, change the first argument supplied to OpenNew to a valid URL.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: