1

We are using EditControl(component from the toolbox) from Syncfusion framework Essential Studio to write a small code-editor. We want to popup the auto-complete window after pressing the shortcut CTRL + SPACE without typing the space-char into the EditorWindow.

Is there any way to disable typing characters into the EditControl?

Private Sub editControl1_KeyDown(sender As Object, e As KeyEventArgs)
        If e.Control Then
        ' Do something here
            If e.KeyCode = Keys.Space Then
                EditControl1.ShowContextChoice()
                Dim context = EditControl1.ContextChoiceController
                For Each item As IConfigLexem In lexeme
                    context.Items.Add((item).BeginBlock, CStr(m_MethodComments(item.ID)), Me.EditControl1.ContextChoiceController.Images("Image" & item.FormatName))
                Next
            End If
        End If
    End Sub
Jegan Raj
  • 22
  • 11
Nano
  • 21
  • 2

1 Answers1

1

You can set-up key bindings within the control which will prevent you needing to trap the KeyDown event.

For example, create some Sub where you configuring the properties of the control (called Editor in my example) and add these lines:

AddHandler Editor.Commands.Add("Editor.ContextChoice").ProcessCommand, AddressOf Editor.ShowContextChoice

Editor.KeyBinder.BindToCommand(Keys.Control Or Keys.Space, "Editor.ContextChoice")

Check your install for a working example of this functionality. It is a good idea to elect to install the samples as they are very comprehensive.

Robin Mackenzie
  • 18,801
  • 7
  • 38
  • 56
  • Thanks for ur response and the example how to do that with bindings. But it is still typing the space-char into the text-field. – Nano Jun 14 '16 at 10:03