How to programmatically disable new Search Overlay Pane

SyntaxEditor for WPF Forum

Posted 4 years ago by Martin - Blaise - Statistics Netherlands
Version: 19.1.0683
Avatar

Hi,

How to programmatically disable the new Search Overlay Pane ? In the help this is mentioned:

Disabling Built-in Search Functionality

To prevent the end user from activating the built-in search features, remove the appropriate entries from the SyntaxEditor.InputBindings collection that correspond to the hotkeys above.

Can you give me an example, e.g. to remove the F3 input binding without knowning the command?

Maybe wourld be nice if there is a property to disable/enable this? ;)

Greetz Martin

Comments (2)

Posted 4 years ago by Martin - Blaise - Statistics Netherlands
Avatar

This seems to work, still would like a property:)

        private void RemoveBuildinSearchPaneBindings()
        {
            // ctrl-F,  F3, ctrl-F3, shift-F3, ctrl-shift-F3, ctrl-H are used for the Search Pane
            List<InputBinding> todelete = new List<InputBinding>();
            foreach (var item in InputBindings)
            {
                if (item is InputBinding ib)
                {
                    if (ib.Gesture is KeyGesture kg)
                    {
                        if (
                              (kg.Key == Key.F && kg.Modifiers == ModifierKeys.Control) ||
                              (kg.Key == Key.F3 && kg.Modifiers>0) ||
                              (kg.Key == Key.H && kg.Modifiers == ModifierKeys.Control)
                           ) {
                            todelete.Add(ib);
                        }
                    }
                }
            }
            todelete.ForEach((i) => InputBindings.Remove(i));
        }            
Answer - Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Martin,

Thanks for the suggestion.  We are adding a SyntaxEditor.HasSearchOverlayPaneKeyBindings property for the next build that you can set to false to turn off access to the built-in search overlay pane.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.