Export (0) Print
Expand All

Window.Activate Method

Attempts to activate the application window by bringing it to the foreground and setting the input focus to it.

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

'Declaration
<SecuritySafeCriticalAttribute> _
Public Function Activate As Boolean

Return Value

Type: System.Boolean
true if the window was successfully activated; otherwise, false.

ExceptionCondition
NotSupportedException

The application is not running outside the browser.

UnauthorizedAccessException

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

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

Use the IsActive property to determine whether the window is already active.

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:
© 2014 Microsoft