Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

How to: Position a Custom Context Menu in a RichTextBox

 

This example shows how to position a custom context menu for a RichTextBox.

When you implement a custom context menu for a RichTextBox, you are responsible for handling the placement of the context menu. By default, a custom context menu is opened at the center of the RichTextBox.

Example

To override the default placement behavior, add a listener for the ContextMenuOpening event. The following example shows how to do this programmatically.

Example

The following example shows an implementation the corresponding ContextMenuOpening event listener.

Show:
© 2016 Microsoft