Table of Contents

Method OnContextMenuOpening

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

OnContextMenuOpening(object?, CancelEventArgs)

Invoked when the context menu is about to open, allowing derived classes to handle or cancel the event.

protected virtual void OnContextMenuOpening(object? sender, CancelEventArgs e)

Parameters

sender object

The source of the event, typically the control that triggered the context menu.

e CancelEventArgs

A CancelEventArgs instance containing the event data, including the ability to cancel the operation.

Remarks

This method is called before the context menu is displayed. Derived classes can override this method to perform custom logic, such as modifying the context menu or preventing it from opening by setting Cancel to true.