ICSharpCode.TextEditor - problem with KeyDown

I am trying to create an autocomplete function for ICSharpCode.TextEditor. But fileTabs_KeyDown does not recognize Enter / Backspace / Tab / ...

I tried adding a new KeyEventHandler to the active editor, but that does not call my KeyDown function.

Maybe I can request Windows messages directly, but I don’t know how to do this, because everyone uses only e.KeyDown or e.KeyPress events.

Please, help...

+5
source share
3 answers

ICSharpCode.TextEditor - . , . textEditor.ActiveTextAreaControl.TextArea.

, . , textEditor.ActiveTextAreaControl.TextArea.KeyEventHandler.

+8

KeyPress, KeyDown KeyEventHandler Enter/Backspace/Tab.
, KeyUp.
KeyEventArgs.KeyCode

0

, "ActiveTextAreaControl.TextArea", , "Enter", "" "", , im CTRL + Space:

public frmConexon()
    {
        InitializeComponent();
        this.txtEditor.ActiveTextAreaControl.TextArea.KeyUp += new System.Windows.Forms.KeyEventHandler(TextArea_KeyUp);
    }

    void TextArea_KeyUp(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Space && e.Control)
        {
            TextArea S = (TextArea)sender;
            MessageBox.Show(string.Format("CTRL + Spacio ({0})", S.Caret.ScreenPosition.ToString()));
        }
    }

In this example, I even get the Caret screen coordinates because I want to show a popup there.

0
source

All Articles