TX Text Control .NET for Windows Forms

CanPaste 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 the clipboard contains a format that can be pasted into a Text Control document. The property's value also depends on the DocumentPermissions.ReadOnly property and the currently set edit mode.

Syntax

public bool CanPaste { get; }

Examples

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

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

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

if (textControl.CanPaste)
{
    textControl.Paste();
}

Limitations

Runtime only.

Read only.