TX Text Control .NET for WPF

TextContextMenu Property

Property|Introduced in 19.0
Namespace
TXTextControl.WPF
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.WPF.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets the context menu, which will be shown. The items depend on the document location where the mouse click occurs. The menu can be altered, extended or completely replaced. When this property is set to null, the WPF.TextControl uses system menu items. To completely suppress a context menu, the Cancel Property must be set the true.

Syntax

public ContextMenu TextContextMenu { get; set; }

Examples

The following example uses TextContextMenuEventArgs.TextContextMenu to configure text context menu as part of the text context menu event args workflow. The configured value is checked before the workflow continues.

textContextMenuEventArgs.TextContextMenu = new System.Windows.Controls.ContextMenu();
if (textContextMenuEventArgs.TextContextMenu != null)
{
    Console.WriteLine("Text Context Menu Event Args: Text Context Menu is available.");
}