How to programmatically disable new Search Overlay Pane

SyntaxEditor for WPF Forum

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was before this thread was created.
Posted 29 days ago by Martin de Jong - 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 29 days ago by Martin de Jong - 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 28 days 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

Add Comment

Please log in to a validated account to post comments.