Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
TopMost Property

Window.TopMost Property

Gets or sets a value that indicates whether the application window is always displayed in front of other windows.

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

public bool TopMost { get; set; }

Property Value

Type: System.Boolean
true if the application window is topmost; otherwise, false. The default is false.

ExceptionCondition
NotSupportedException

The application is not running outside the browser.

UnauthorizedAccessException

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

SecurityException

When setting this property, except in response to a user-initiated action, the Application.Startup event has already occurred and Application.HasElevatedPermissions is false.

You can set this property only in the following cases:

If multiple applications have main windows with TopMost values of true, the actual topmost window is the one most recently active.

In Silverlight 5, trusted, out-of-browser applications can create multiple Window instances and manipulate them programmatically. However, the TopMost property is meaningful only for the Application.MainWindow instance.

Silverlight

Supported in: 5, 4

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

Community Additions

ADD
Show:
© 2015 Microsoft