Skip to main content
All docs
V23.2

ClipboardAccessPolicy.SuppressClearOperations() Method

Applies a policy to suppress clipboard clearing operations performed by DevExpress WinForms and WPF controls.

Namespace: DevExpress.Data.Utils

Assembly: DevExpress.Data.Desktop.v23.2.dll

NuGet Packages: DevExpress.Data.Desktop, DevExpress.ExpressApp.Win.Design

Declaration

public static void SuppressClearOperations()

Remarks

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());
        }
    }
}

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