ClipboardAccessPolicy.SuppressCopyOperations() Method
Applies a policy to suppress all copy-to-clipboard operations within DevExpress WinForms and WPF controls.
Namespace: DevExpress.Data.Utils
Assembly: DevExpress.Data.Desktop.v24.1.dll
NuGet Packages: DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
Declaration
Remarks
Use the SuppressCopyOperations
method to prevent users from copying data displayed by DevExpress controls in Windows Forms and WPF applications to the clipboard. Call the SuppressCopyOperations
method at application startup.
using System;
using System.Windows.Forms;
using DevExpress.Data.Utils;
namespace DXApplication {
internal static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ClipboardAccessPolicy.SuppressCopyOperations();
Application.Run(new Form1());
}
}
}
The Clipboard Access Policy fires the Copying event when a user attempts to copy data to the clipboard and allows you to allow (or cancel) the operation based on a specific condition. If you disabled copy-to-clipboard operations, set the e.Cancel
parameter to false
to allow the operation.
Read the following topic for additional information: Clipboard Access Policy.