2

I'm basically looking for a replacement for RichTextBox or TextBox components that is fully written in c# without using pinvokes in order to keep cross platform compatibility.

RichTextBox contains for example functionality to highlight URLs in the text and provide a handler for event when user clicks on the link. But there is no way to specify what regex is used for that highlighting so there is no way to add support for URI schemes other than http/https.

1
  • I don't think you'll find one.
    – SLaks
    Dec 25, 2009 at 15:10

4 Answers 4

2

Mono's RichTextBox is written in C# and is open source:

http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs

It will take some work to separate it from Mono and get it running the way you want it, but it's better than starting from scratch.

1
  • Have looked at it, it inherits regular text box, but I do agree that this is probably the best option short of doing everything myself down to the control painting level.
    – Latifer
    Dec 26, 2009 at 3:59
1

Take a look at GtkSharp with TextView. It is cross-platform.

1
  • I have been looking at gtk#, but I have a fairly big winforms app already, and mono got pretty good at taking winforms apps multiplatform. Just that RTB is so inflexible and impossible to extend in a platform neutral way.
    – Latifer
    Dec 25, 2009 at 22:08
1

This might be a little overkill for what you're looking for, but have you considered SyntaxEditor from Actipro? (http://www.actiprosoftware.com/Products/DotNet/WindowsForms/SyntaxEditor/Default.aspx)

Yes, it is a commercial (i.e. not free) product, but it is capable of doing what you wanted, and more. Its 100% managed code, and supports some language plugins, e.g. a web-language add-in.

Might be worth a look.

1
  • This is a syntax-highlighting editor; he (presumably) wants a rich-text editor which allows the end-user to apply formatting at will.
    – SLaks
    Dec 25, 2009 at 19:34
1

The text editors with SharpDevelop and MonoDevelop may be useful.

Not the answer you're looking for? Browse other questions tagged or ask your own question.