Windows Dev Center

Expand Minimize

AutomationPeer.ShowContextMenu method

Shows the available context menu for the owner element.

Syntax


public void ShowContextMenu()

Parameters

This method has no parameters.

Remarks

Calling ShowContextMenu throws an error if a context menu cannot be shown. If no context menu is available directly on the element on which it was invoked, the Microsoft UI Automation logic implemented by a provider should attempt to show a context menu for the UI Automation tree parent of the element.

Scenarios for invoking a context menu from an element include auto-correction and spelling alternatives for text input. The UI elements that display these are not part of the default tab sequence and are not part of an initial UI Automation tree until the context that requires them is detected.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Automation.Peers
Windows::UI::Xaml::Automation::Peers [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Automation.Peers
Windows::UI::Xaml::Automation::Peers [C++]

Metadata

Windows.winmd

See also

AutomationPeer

 

 

Show:
© 2015 Microsoft