views:

930

answers:

5

I am looking for a way to edit a piece of HTML (such as an email text) in a Windows app (either WinForms or WPF). So this should work not unlike the little editor I have available to myself right here on the stackoverflow site (well, except more wysiwyg, I guess), except I want to do the same thing in WPF/WinForms.

Anyway: You get the idea: HTML editing in windows apps like it used to be possible with the old DHTML edit control.

Any suggestions would be highly appreciated.

A: 

WinForms has a rich text control you can use to an extent, but any RTF to HTML would be third-party (Here is just one example). I can't answer WPF, but it seems like the FlowDocument and RichTextBox would be the idea there. I think you'd have a similar issue, converting the RTF to HTML.

JJO
Hm, that link doesn't link to a third party control. It only shows how to copy out of VS in HTML format.The RTF textboxes don't work, because I do need support for things like tables and a few other simple things.
I believe RTF does support tables, to some extent at least.
Velika
A: 

I used this HTML editor, based on the IE Web Browser control, in my WinForms app. It worked well, though there is a large 10MB COM Interop dependency file.

http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx

Velika
This soliution uses a browser, actually. That is the best I was able to come up with so far too. I was hoping to avoid that though, so I didn't have the browser dependency and the interop and all that... :-(
I have used that control in conjunction with TinyMCE... Works good, but as just already mentioned: browser dependency and interop is not nice
Peter Gfader
A: 

Hi,

take a look at the HTMLTextbox library on codeplex (http://winformhtmltextbox.codeplex.com/). I know, it's also using a browser control but it's working great. I use it in my own applications (here an example: http://www.code4ward.net/main/Flash/Gallery/large/5C9816C8-7C8F-4A47-8607.png)

Stefan Koell
Thanks. Like I said above, unfortunately, the browser dependency is really a deal killer in my scenario... :-(
A: 

I have found this editor that does not requires Microsoft.mshtml. However, it requires some additional works to get a nice formatting buttons bar around.

controlbreak
A: 

You could try the ModelText HTML Control (disclosure: I wrote it).

It is what you are asking for, and the only thing of its kind as far as I know: i.e. it's to edit HTML in Winforms, without depending on a browser and interop.

ChrisW