Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Window.Activate Method ()

 

Attempts to bring the window to the foreground and activates it.

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

[SecurityCriticalAttribute]
public bool Activate()

Return Value

Type: System.Boolean

true if the Window was successfully activated; otherwise, false.

The rules that determine whether the window is activated are the same as those used by the Win32 SetForegroundWindow function (User32.dll).

If the window is activated in a Windows Presentation Foundation (WPF) application that is not the user's foreground application, Activated event is raised.

System_CAPS_noteNote

This method cannot be called when a window is hosted in a browser.

UIPermission

for permission to activate a window. Associated enumeration: AllWindows

.NET Framework
Available since 3.0
Silverlight
Available since 4.0
Return to top
Show:
© 2016 Microsoft