This documentation is archived and is not being maintained.

Window.ShowActivated Property

Updated: July 2008

Gets or sets a value that indicates whether a window is activated when first shown. This is a dependency property.

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

public bool ShowActivated { get; set; }
<object ShowActivated="bool" .../>

Property Value

Type: System.Boolean
true if a window is activated when first shown; otherwise, false. The default is true.

Identifier field


Metadata properties set to true


When a window with its ShowActivated property set to false is opened, the window is not activated and its Activated event is not raised until a user manually activates the window by selecting it. After the window is selected, it activates and deactivates normally.

To prevent a window from being activated when it opens, the ShowActivated property must be set to false before the window is shown (by calling Show); setting ShowActivated to false after a window is shown has no effect.

Setting ShowActivated to false on a window that is opened modally, by calling ShowDialog, has no real impact. Although the modal window will not be activated, the modal window will prevent the user from activating any other open application windows.

For an example that demonstrates how to show a window without activating it, see Show a Window Without Activating Sample.

The following example shows how to use markup to configure a window to be opened without being activated.

using System.Windows; // Window 

namespace WindowShowActivatedSnippets
    public partial class AWindow : Window
        public AWindow()

The following example shows how to use code to configure a window to be opened without it being activated.

AWindow window = new AWindow();
window.ShowActivated = false;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1, 3.0 SP2




July 2008

Added topic for new member.

SP1 feature change.