corelibraries-devexpress-dot-data-dot-utils-74fa9e1f.md
Allows you to control clipboard-related operations initiated by users and DevExpress UI controls for WinForms and WPF.
Namespace : DevExpress.Data.Utils
Assembly : DevExpress.Data.Desktop.v25.2.dll
NuGet Packages : DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
public static class ClipboardAccessPolicy
Public Module ClipboardAccessPolicy
Use the following methods to apply a policy (call these methods at application startup):
The following example demonstrates how to allow users to copy data in ANSI text format displayed in a DevExpress UI control to the clipboard. If the control displays data in a different format, the copy-to-clipboard operation is canceled:
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());
}
}
}
Imports System
Imports System.Windows.Forms
Imports DevExpress.Data.Utils
Namespace DXApplication
Friend Module Program
''' <summary>
''' The main entry point for the application.
''' </summary>
<STAThread>
Sub Main()
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
ClipboardAccessPolicy.SuppressCopyOperations()
Application.Run(New Form1())
End Sub
End Module
End Namespace
You can also handle Copying, Pasting, and Clearing events to allow or cancel clipboard operations based on a specific condition.
Read the following topic for more information: Clipboard Access Policy.
Object ClipboardAccessPolicy
See Also