Partager via


Window.IsActive Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets a value that indicates whether the window is active.

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

Syntax

'Declaration
Public ReadOnly Property IsActive As Boolean
public bool IsActive { get; }

Property Value

Type: System.Boolean
true if the window is active; otherwise, false.

Exceptions

Exception Condition
NotSupportedException

The application is not running outside the browser.

UnauthorizedAccessException

The current thread is not the user interface (UI) thread.

Remarks

An active window is the user's current foreground window and has the focus, which is signified by the active appearance of the title bar. An active window is also the top-most of all top-level windows that do not explicitly set the TopMost property.

Use the Activate method to attempt to activate the window if it is not already active.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.