RichEditBox.ContextMenuOpening 事件

定义

当系统处理显示上下文菜单的交互时发生。

public:
 virtual event ContextMenuOpeningEventHandler ^ ContextMenuOpening;
// Register
event_token ContextMenuOpening(ContextMenuOpeningEventHandler const& handler) const;

// Revoke with event_token
void ContextMenuOpening(event_token const* cookie) const;

// Revoke with event_revoker
RichEditBox::ContextMenuOpening_revoker ContextMenuOpening(auto_revoke_t, ContextMenuOpeningEventHandler const& handler) const;
public event ContextMenuOpeningEventHandler ContextMenuOpening;
function onContextMenuOpening(eventArgs) { /* Your code */ }
richEditBox.addEventListener("contextmenuopening", onContextMenuOpening);
richEditBox.removeEventListener("contextmenuopening", onContextMenuOpening);
- or -
richEditBox.oncontextmenuopening = onContextMenuOpening;
Public Custom Event ContextMenuOpening As ContextMenuOpeningEventHandler 
<RichEditBox ContextMenuOpening="eventhandler" />

事件类型

示例

提示

有关详细信息、设计指南和代码示例,请参阅 上下文菜单指南

如果已安装 WinUI 2 库 应用,请单击此处 打开该应用,并查看 自定义 RichEditBox 的 CommandBarFlyout - 添加“Share” 示例

适用于