TX Text Control .NET for Windows Forms

CanCopy Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Informs whether a part of a Text Control document has been selected and can be copied to the clipboard. The property's value also depends on the DocumentPermissions.AllowCopy property and the currently set edit mode.

Syntax

public bool CanCopy { get; }

Examples

The following XAML example shows how to bind the CanCopy property to the IsEnabled attribute of a menu item.

<MenuItem
   Header="Copy"
   Command="ApplicationCommands.Copy"
   IsEnabled="{Binding ElementName=textControl1, Path=CanCopy}" />

The following example checks can copy before performing the related operation.

if (textControl.CanCopy)
{
    textControl.Copy();
}

Limitations

Runtime only.

Read only.