Trying to find a control that will display nicely formatted text (preferably HTML) dynamically on a Windows form. Does anyone know or have experience with such a beast I have searched all over the Net and found lots of "browser" controls, but I don't want a Web browser - I just want to display nicely formatted text on a Windows form!!
Like this:
Dim sbText as New StringBuilder()
With sbText
.Append("<p><b>This is a bold statement!</b></p>")
.Append("<p>This is a not-so-bold statement.</p>")
End With
Me.SomeCoolLabelControl.Text = sbText.toString()
Any help here would be GREATLY appreciated!

I'm going nuts here...
Gary zhuo
Miskky
I guess I could do that - if I could figure out all those crazy RTF codes...and then maybe pass the html string through some kind of an HTML to RTF converter...
Am I the only one that wants/needs this kind of a control
I can't stand looking at and creating "standard" Windows forms applications. What does MS use to create apps like Microsoft Money How do they create their "search results" task pane - that has to be created on the fly, right Why can't MS make that kind of technology easily available in thier Windows development tools
grrr...
Harshal Kherde
Oh brother! (...or sister...or whatever) ...give me a break.
I've been programming since 1986, and I use the best language for the job. C# isn't more "real" than any other programming language I've ever used.
emp
I tried that one - it didn't seem to work very well, at least for me. In addition, there is no documentation. The page states it supports "semi-compatible" HTML tags, but I couldn't figure out what tags it supports and what it doesn't. I couldn't get a response from the "company" that developed it, so I dropped it like a hot potato.
BenoitFranc
Unless you know about another label control that I don't know about, in which case Please Enlighten Me!
JimScudder
I'm not sure a webbrowser control would work, anyway. Doesn't that require you to have an HTML page to load The last time I checked you couldn't stream a string of HTML into it, like I showed in my original example.
Also, the webbrowser control is ActiveX, which introduces unwanted dependencies into the project. If I wanted to build an HTML browser/editor, I might use something like the webbrowser control. That's not what I want to do, however.
Frank Boyne
I did come across a control from a company called SyncFusion that has a Web browser control called HTMLUI. It allows me to set the text property of the control like in your example. However, they want about 500 bucks for it, and I don't know if I can justify that price for fancy labels.
Thanks,
Charles
mbkh_84
http://www.itwriting.com/htmleditor/index.php
it will be using mshtml though---another 8 meg lib---maybe you don't care---anyway---you can download the source w/demo app
Luis Mack
you can use MSHTML with WebBrowser here is a link:
http://www.codeproject.com/csharp/webbrowser.asp
of course the code is in C#, but it is your chance to graduate from VB to a real language :)
HTH
Regards
JoePD
Take care,
Ronald
Mareen Philip.
It's a bit clumsy. It would've been great if it supported HTML.
mladjoboy
I know that you have said a few times so far that you don't want to use a web browser, but I wanted to bring your attention to the web browser WinForms control that will be added to VS 2005. It is incredibly easy to do exactly what you want to do using this control, and other than the fact that the underlying control is ActiveX like you mentioned, there is no reason you wouldn't want to use it. Here's why:
The code example that you gave at the beginning works with the web browser.
Just drag a web browser onto the form, and change the line:
Me.SomeCoolLabelControl.Text = sbText.toString()
to
Me.webBrowser1.DocumentText = sbText.toString()
That's it, and it will be able to display any sort of html formatting you would want it to.
Also if you don't want it to act in any way like a web browser, and more like a label, you can set AllowWebBrowserDrop, ScrollBarsEnabled, and WebBrowserShortcutsEnabled to false in the designer. Now you have a "label" that can parse html and format the text correctly.
I hope this helps.
Scott Morrison
Windows Forms PM
Microsoft Corp.
Muty
http://www.compona.com/WikiEngine/WikiPageViewer.ascx ID=44
-Lee
HaidongJi
I do agree that it would be very useful to have the ability to use simple HTML to format the text, like that in Java Swing controls.