共用方式為


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' 範例

適用於