Skip to main content
All docs
V25.1
  • TokenEdit.QueryAdvancedMode Event

    Occurs for all TokenEdit controls in the project.

    Namespace: DevExpress.XtraEditors

    Assembly: DevExpress.XtraEditors.v25.1.dll

    NuGet Package: DevExpress.Win.Navigation

    Declaration

    public static event EventHandler<TokenEdit.QueryAdvancedModeEventArgs> QueryAdvancedMode

    Event Data

    The QueryAdvancedMode event's data class is TokenEdit.QueryAdvancedModeEventArgs. The following properties provide information specific to this event:

    Property
    Editor
    Parent
    ParentForm
    RepositoryItem
    UseAdvancedMode

    The event data class exposes the following methods:

    Method
    GetParent<TContainer>()

    Remarks

    The QueryAdvancedMode event fires for every TokenEdit control in the project and allows you to configure Advanced Mode settings based on your preferences.

    The following code snippet handles the QueryAdvancedMode event to enable Advanced Mode and customize related options for all TokenEdit controls displayed on Form1:

    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using System;
    using System.Drawing;
    using System.Windows.Forms;
    
    namespace DXApplication {
        internal static class Program {
            [STAThread]
            static void Main() {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                TokenEdit.QueryAdvancedMode += TokenEdit1_QueryAdvancedMode;
                Application.Run(new Form1());
            }
            static void TokenEdit1_QueryAdvancedMode(object sender, TokenEdit.QueryAdvancedModeEventArgs e) {
                if(e.ParentForm is Form1) {
                    // Enable Advanced Mode    
                    e.UseAdvancedMode = DefaultBoolean.True;
                    // Enable caret animation
                    e.Editor.Properties.AdvancedModeOptions.AllowCaretAnimation = DefaultBoolean.True;
                    // Animate selection
                    e.Editor.Properties.AdvancedModeOptions.AllowSelectionAnimation = DefaultBoolean.True;
                    // Set the selection color
                    e.Editor.Properties.AdvancedModeOptions.SelectionColor = Color.Yellow;
                }
            }
        }
    }
    
    See Also