HtmlWindow::IsClosed Property

 

Gets a value indicating whether this window is open or closed.

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

public:
property bool IsClosed {
	bool get();
}

Property Value

Type: System::Boolean

true if the window is still open on the screen; otherwise, false.

If the HtmlWindow has been closed by the user or by way of a call to the Close method, attempting to navigate to a new URL or access the window's document will result in an error. Use this property to determine whether it is safe to call properties and methods on the current window object.

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 requires that your form has a WebBrowser control named WebBrowser1, a Button named Button1, and a Timer class named Timer1.

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

.NET Framework
Available since 2.0
Return to top
Show: