We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is this proper way to disable shortcut keys of SfRichTextBoxAdv?

Thread ID:

Created:

Updated:

Platform:

Replies:

125327 Aug 8,2016 09:43 PM UTC Aug 9,2016 05:13 AM UTC WPF 1
loading
Tags: SfRichTextBoxAdv
Dat Vo
Asked On August 8, 2016 09:43 PM UTC

In my program, I want to manually process the New/Open/Save commands, but SfRichTextBoxAdv takes priority of those hotkeys. Therefore currently I use this code to remove them:

        public MainWindow()
        {
            InitializeComponent();

            var removingGestures = new List<InputBinding>();
            foreach (InputBinding inputBinding in this.documentEditor.InputBindings)
            {
                var gesture = inputBinding.Gesture as KeyGesture;

                if (gesture != null && gesture.Modifiers == ModifierKeys.Control)
                {
                    if (gesture.Key == Key.O) { removingGestures.Add(inputBinding); }
                    if (gesture.Key == Key.S) { removingGestures.Add(inputBinding); }
                    if (gesture.Key == Key.N) { removingGestures.Add(inputBinding); }
                }
            }

            foreach (var gesture in removingGestures)
            {
                this.documentEditor.InputBindings.Remove(gesture);
            }

            this.DataContext = this.Model = new MainPageViewModel();
        }

Just want to ask if this is the proper way? Is there any property I can set to disable the default behaviors?

Emmima Josephine Jeyapaul [Syncfusion]
Replied On August 9, 2016 05:13 AM UTC

Hi Dat Vo, 
Yes, you can proceed with your code for disabling default input key binding (New/Open/Save commands) in SfRichTextBoxAdv control. Currently there is no property (API) available to disable the default behaviours. 
. 
Regards, 
Emmima. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;