Topics: Developer Forum, User Forum
Oct 12, 2012 at 4:23 PM

First time poster, old programmer, new to scintillaNET...

Basically, I want to add an event handler when people press a key, I have something like this:-


private void scintilla1_OnCharAdded(object sender, ScintillaNET.CharAddedEventArgs e)




Now, I havent a clue where to put it?

I've tried "View Code" on the control, which sends me to the Form1.cs file, so, I paste the code in there (Underneath some ...MenuItem_Click() events!

When I run the app, and I hit a key, nothing is appended, I've even tried a messasebox, but, alas, not a sausage.

Any tips to get this working, I feel a bit silly because this seems like basic stuff, and I cannot fathom it! :)

Thanks in advance

Oct 13, 2012 at 7:23 PM

Why don't you just use OnKeyPress event?

Here I give you it's header:

Private Sub SyntaxHandle_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles SyntaxHandle.KeyPress
    'Write what u want here
End Sub