WindowPattern.Close Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Attempts to close the current window.

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

member Close : unit -> unit

Exception Condition
InvalidOperationException

The control is unable to perform the requested action.

ElementNotAvailableException

When the control is no longer available.

When called on a split pane control, this method will close the pane and remove the associated split. This method may also close all other panes depending on implementation.

In the following example, a WindowPatterncontrol pattern is obtained from an AutomationElement and is subsequently used to close the AutomationElement.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: