Wednesday, March 13, 2013

Extending Scintilla with modifiable ContextMenu

Recently I've been working on using ScintillaNET in I'm Only Resting, namely as the text editor for the Response Body content. An early issue I ran into was that the Scintilla control does not allow access to or modification of the built-in context menu. However I was able to easily extend the Scintilla control with a hand-built ContextMenu that is exactly the same as the one built-in except it can be accessed and modified like any normal .NET control.

The code is as follows:

4 comments:

  1. Hello Mr. Swensen,
    I have downloaded your project "I´m only resting". You are using ScinitillaNET Dll in 2.0 version. UndoRedo and other actions are not present in the current 4.0 version. Is there any workaround to get the context menu?
    Thanks
    Filip

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. I have used slightly different Scintilla methods for delegates (Undo, Redo).
      https://github.com/FilipRychnavsky/ScintillaNET.Demo/blob/ContextMenuItem/ScintillaNET.Demo/StandardScintilla.cs

      Delete