Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ICSharpCode.TextEditor - KeyDown problem

I'm trying to create an auto-complete function for the ICSharpCode.TextEditor. But the fileTabs_KeyDown doesn't recognize Enter/Backspace/Tab/...

I tried to add a new KeyEventHandler to the active editor but that doesn't call my KeyDown function.

Maybe I can request the windows messages directly but I don't know how to do this because everyone is only using e.KeyDown or e.KeyPress events.

Please help...

like image 993
zee Avatar asked Sep 06 '09 19:09

zee


1 Answers

ICSharpCode.TextEditor is a composite control. If you attach event handlers to the main text editor, you won't receive any events. You have to attach to the events on textEditor.ActiveTextAreaControl.TextArea instead.

Also, the text editor itself is already handling the events. To intercept key presses, use the special event textEditor.ActiveTextAreaControl.TextArea.KeyEventHandler.

like image 109
Daniel Avatar answered Oct 18 '22 05:10

Daniel