5

I have a Windows Form with a text-box, into which a user may write a Python script.

I'm using Scintilla in the form but I want its area to be a textbox. Is there any way I can bind Scintilla to a textbox?

Below is code I have tried:

 this.scintilla2.ConfigurationManager.Language = "python";
 this.scintilla2.Dock = System.Windows.Forms.DockStyle.Fill;
 this.scintilla2.Location = new System.Drawing.Point(600, 430);
 this.scintilla2.Name = "scintilla2";
 this.scintilla2.TabIndex = 0;
 this.Controls.Add(this.scintilla2);
Benjamin Hodgson
  • 42,952
  • 15
  • 108
  • 157
Jana
  • 153
  • 5
  • any clue or help on this topic – Jana Nov 10 '14 at 17:28
  • 2
    Why do you want to bind it to a textbox? What would you like to achieve with it? – Biri Dec 27 '14 at 11:27
  • scintilla is already a textbox of sorts with advanced features like syntax hightling, etc. There is a textchanged event on it that you can also trigger off of to 'bind' to the text of another textbox if you want. Btw - I went down this same path and ended up using AvalonEdit instead. Also b/c mine is a WPF app, but I still think AvalonEdit is much friendlier to enhancements (on the fly code completion, etc.). – outbred Feb 11 '15 at 00:34

1 Answers1

0

You can use ScintillaNET

Download the component, unzip and add it to your "ToolBox" in Visual Studio. Add the path of Scintilla folder to the "Environment Variables", and you are ready to use it on your project.

Here you can find a source code sample.