HtmlWindow::IsClosed Property
.NET Framework (current version)
Gets a value indicating whether this window is open or closed.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue 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.
.NET Framework
Available since 2.0
Available since 2.0
Show: