corelibraries-devexpress-dot-data-dot-utils-dot-clipboardaccesspolicy-8c034b70.md
Applies a policy to suppress clipboard clearing operations performed by DevExpress WinForms and WPF controls.
Namespace : DevExpress.Data.Utils
Assembly : DevExpress.Data.Desktop.v25.2.dll
NuGet Packages : DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design
public static void SuppressClearOperations()
Public Shared Sub SuppressClearOperations
DevExpress controls clear the clipboard on demand. Call the SuppressClearOperations on application startup to disable clipboard clearing operations for all DevExpress controls in the application.
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.SuppressClearOperations();
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.SuppressClearOperations()
Application.Run(New Form1())
End Sub
End Module
End Namespace
The Clipboard Access Policy fires the Clearing event when a control attempts to clear the clipboard and allows you to allow (or cancel) the operation based on a specific condition. If you applied the Clipboard Access Policy, set the e.Cancel parameter to false to allow the operation.
Read the following topic for additional information: Clipboard Access Policy.
See Also