HTMLWindowEvents4::oncontextmenu Event

New for Internet Explorer 9

[This documentation is preliminary and is subject to change.]

Fires when the user clicks the right mouse button in the client area, opening the context menu.

Syntax

VARIANT_BOOL oncontextmenu(VOID);

Return Value

If the event bubbles and is cancellable, return VARIANT_TRUE to prevent the event from bubbling to other event handlers in the document tree. Return VARIANT_FALSE to allow bubbling.

Event DISPID

DISPID_HTMLWINDOWEVENTS4_ONCONTEXTMENU

The DISPID for this event is defined in mshtmdid.h. Use this value to identify the event handler when implementing IDispatch::Invoke.

Event Information

Bubbles Yes
Cancels Yes
To invoke Right-click the object.
Default action Opens the context menu. To cancel the default behavior, set the returnValue property of the event object to false.