views:

492

answers:

5

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.

A: 

why would anyone provide a html component thats only compatible with c# developers.

Numenor
What are you talking about?
SLaks
ah i missunderstand thought he was looking for html component.
Numenor
A: 

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

supercheetah
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
+1  A: 

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.

kmontgom
This is a syntax-highlighting editor; he (presumably) wants a rich-text editor which allows the end-user to apply formatting at will.
SLaks
+1  A: 

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.

jpobst
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
A: 

The text editors with SharpDevelop and MonoDevelop may be useful.

FlappySocks